mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
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:
parent
c1815b8277
commit
70d5f595c7
4 changed files with 6 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue