TW-1584: attr.{isnt,not} use partial matching
- Change attr.{isnt,not} to be the exact opposite of attr{:is,:},
i.e. exact matching.
- Fix tests that assumed the old behavior was intended.
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
to Ulf Eliasson).
|
to Ulf Eliasson).
|
||||||
- TW-1583 Invalid ID displayed for first report after done/delete (thanks to
|
- TW-1583 Invalid ID displayed for first report after done/delete (thanks to
|
||||||
Ulf Eliasson).
|
Ulf Eliasson).
|
||||||
|
- TW-1584 attr.{isnt,not} use partial matching.
|
||||||
- TW-1587 Fix and improve example on-exit hook, adjust to new hooks API
|
- TW-1587 Fix and improve example on-exit hook, adjust to new hooks API
|
||||||
(thanks to Jochen Sprickerhof).
|
(thanks to Jochen Sprickerhof).
|
||||||
- TW-1588 Most Export scripts cannot deal with new export format (thanks to
|
- TW-1588 Most Export scripts cannot deal with new export format (thanks to
|
||||||
|
|||||||
@@ -1234,7 +1234,7 @@ void CLI::desugarFilterAttributeModifiers ()
|
|||||||
}
|
}
|
||||||
else if (modifier == "isnt" || modifier == "not")
|
else if (modifier == "isnt" || modifier == "not")
|
||||||
{
|
{
|
||||||
op.attribute ("raw", "!=");
|
op.attribute ("raw", "!==");
|
||||||
rhs.attribute ("raw", "'" + value + "'");
|
rhs.attribute ("raw", "'" + value + "'");
|
||||||
rhs.tag ("LITERAL");
|
rhs.tag ("LITERAL");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ unlike ($output, qr/two/, "$ut: list - two included");
|
|||||||
|
|
||||||
$output = qx{../src/task rc:$rc list pro.not:a 2>&1};
|
$output = qx{../src/task rc:$rc list pro.not:a 2>&1};
|
||||||
like ($output, qr/zero/, "$ut: list - zero included");
|
like ($output, qr/zero/, "$ut: list - zero included");
|
||||||
unlike ($output, qr/one/, "$ut: list - one excluded");
|
like ($output, qr/one/, "$ut: list - one included");
|
||||||
unlike ($output, qr/two/, "$ut: list - two excluded");
|
unlike ($output, qr/two/, "$ut: list - two excluded");
|
||||||
|
|
||||||
$output = qx{../src/task rc:$rc list pro.not:a.b 2>&1};
|
$output = qx{../src/task rc:$rc list pro.not:a.b 2>&1};
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ class TestFilterPrefix(TestCase):
|
|||||||
def test_list_project_not_foo(self):
|
def test_list_project_not_foo(self):
|
||||||
"""Filter on not project name."""
|
"""Filter on not project name."""
|
||||||
code, out, err = self.t(('list', 'project.not:foo'))
|
code, out, err = self.t(('list', 'project.not:foo'))
|
||||||
self.assertNotIn('one', out)
|
self.assertIn('one', out)
|
||||||
self.assertNotIn('two', out)
|
self.assertIn('two', out)
|
||||||
self.assertNotIn('three', out)
|
self.assertIn('three', out)
|
||||||
self.assertIn('four', out)
|
self.assertIn('four', out)
|
||||||
self.assertIn('five', out)
|
self.assertIn('five', out)
|
||||||
self.assertIn('six', out)
|
self.assertIn('six', out)
|
||||||
@@ -112,18 +112,6 @@ class TestFilterPrefix(TestCase):
|
|||||||
self.assertIn('seven', out)
|
self.assertIn('seven', out)
|
||||||
self.assertIn('eight', out)
|
self.assertIn('eight', out)
|
||||||
|
|
||||||
def test_list_project_not_ba(self):
|
|
||||||
"""Filter on project partial non-match."""
|
|
||||||
code, out, err = self.t(('list', 'project.not:ba'))
|
|
||||||
self.assertIn('one', out)
|
|
||||||
self.assertIn('two', out)
|
|
||||||
self.assertIn('three', out)
|
|
||||||
self.assertNotIn('four', out)
|
|
||||||
self.assertNotIn('five', out)
|
|
||||||
self.assertNotIn('six', out)
|
|
||||||
self.assertNotIn('seven', out)
|
|
||||||
self.assertNotIn('eight', out)
|
|
||||||
|
|
||||||
def test_list_description_has_foo(self):
|
def test_list_description_has_foo(self):
|
||||||
"""Filter on description pattern."""
|
"""Filter on description pattern."""
|
||||||
code, out, err = self.t(('list', 'description.has:foo'))
|
code, out, err = self.t(('list', 'description.has:foo'))
|
||||||
|
|||||||
Reference in New Issue
Block a user