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:
Wilhelm Schuermann 2015-04-02 12:45:39 +02:00
parent c1815b8277
commit 70d5f595c7
4 changed files with 6 additions and 17 deletions

View file

@ -9,6 +9,7 @@
to Ulf Eliasson).
- TW-1583 Invalid ID displayed for first report after done/delete (thanks to
Ulf Eliasson).
- TW-1584 attr.{isnt,not} use partial matching.
- TW-1587 Fix and improve example on-exit hook, adjust to new hooks API
(thanks to Jochen Sprickerhof).
- TW-1588 Most Export scripts cannot deal with new export format (thanks to

View file

@ -1234,7 +1234,7 @@ void CLI::desugarFilterAttributeModifiers ()
}
else if (modifier == "isnt" || modifier == "not")
{
op.attribute ("raw", "!=");
op.attribute ("raw", "!==");
rhs.attribute ("raw", "'" + value + "'");
rhs.tag ("LITERAL");
}

View file

@ -66,7 +66,7 @@ unlike ($output, qr/two/, "$ut: list - two included");
$output = qx{../src/task rc:$rc list pro.not:a 2>&1};
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");
$output = qx{../src/task rc:$rc list pro.not:a.b 2>&1};

View file

@ -79,9 +79,9 @@ class TestFilterPrefix(TestCase):
def test_list_project_not_foo(self):
"""Filter on not project name."""
code, out, err = self.t(('list', 'project.not:foo'))
self.assertNotIn('one', out)
self.assertNotIn('two', out)
self.assertNotIn('three', out)
self.assertIn('one', out)
self.assertIn('two', out)
self.assertIn('three', out)
self.assertIn('four', out)
self.assertIn('five', out)
self.assertIn('six', out)
@ -112,18 +112,6 @@ class TestFilterPrefix(TestCase):
self.assertIn('seven', 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):
"""Filter on description pattern."""
code, out, err = self.t(('list', 'description.has:foo'))