diff --git a/ChangeLog b/ChangeLog index bfc9572a1..aab5e6582 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,8 @@ Reeder). - TW-1626 Wrong wait date (thanks to Andrea Rizzi). - TW-1632 Japanese translation for Taskwarrior(150713) (thanks to ribbon). +- TW-1634 due.not: excludes only tasks scheduled at mitnight (thanks to + Tomas Babej). - Prevent potential task duplication during import for non-pending tasks. - Show the active context in "context list", if any is active. - Fix "task edit" dropping annotation text after newlines. diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 82644aa57..a1fb95eab 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -1157,14 +1157,19 @@ void CLI2::desugarFilterAttributes () op.attribute ("raw", "!=="); rhs.attribute ("raw", "''"); } - else if (mod == "is" || mod == "equals") + else if (mod == "is") + { + op.attribute ("raw", "="); + rhs.attribute ("raw", value); + } + else if (mod == "equals") { op.attribute ("raw", "=="); rhs.attribute ("raw", value); } else if (mod == "isnt" || mod == "not") { - op.attribute ("raw", "!=="); + op.attribute ("raw", "!="); rhs.attribute ("raw", value); } else if (mod == "has" || mod == "contains") diff --git a/test/tw-1634.t b/test/tw-1634.t index ee3c93dda..e04f47f2b 100755 --- a/test/tw-1634.t +++ b/test/tw-1634.t @@ -40,44 +40,45 @@ class Test1634(TestCase): self.t = Task() # Setup some tasks due on 2015-07-07 - self.t('add due:2015-07-07T00:00:00 on due date 1') - self.t('add due:2015-07-07T08:00:00 on due date 2') - self.t('add due:2015-07-07T14:34:56 on due date 3') - self.t('add due:2015-07-07T22:00:00 on due date 4') - self.t('add due:2015-07-07T23:59:59 on due date 5') + self.t('add due:2015-07-07T00:00:00 ON1') + self.t('add due:2015-07-07T14:34:56 ON2') + self.t('add due:2015-07-07T23:59:59 ON3') # Setup some tasks not due on 2015-07-07 - self.t('add due:2015-07-06T23:59:59 not on due date 1') - self.t('add due:2015-07-08T00:00:00 not on due date 2') - self.t('add due:2015-07-08T00:00:01 not on due date 3') - self.t('add due:2015-07-06T00:00:00 not on due date 4') - + self.t('add due:2015-07-06T23:59:59 OFF4') + self.t('add due:2015-07-08T00:00:00 OFF5') + self.t('add due:2015-07-08T00:00:01 OFF6') + self.t('add due:2015-07-06T00:00:00 OFF7') def test_due_match_not_exact(self): """Test that due: matches any task that date.""" - code, out, err = self.t('due:2015-07-07 minimal') - # Assert that each task on 2015-07-07 is listed - for i in range(1,5): - self.assertIn("on due date {0}".format(i), out) + # Asswer that only tasks ON the date are listed. + self.assertIn("ON1", out) + self.assertIn("ON2", out) + self.assertIn("ON3", out) - # Assert that no task not on 2015-07-07 is not listed - for i in range(1,4): - self.assertNotIn("not on due date {0}".format(i), out) + # Assert that tasks on other dates are not listed. + self.assertNotIn("OFF4", out) + self.assertNotIn("OFF5", out) + self.assertNotIn("OFF6", out) + self.assertNotIn("OFF7", out) def test_due_not_match_not_exact(self): """Test that due.not: does not match any task that date.""" - code, out, err = self.t('due.not:2015-07-07 minimal') - # Assert that every task not on 2015-07-07 is listed - for i in range(1,4): - self.assertIn("not on due date {0}".format(i), out) + # Assert that task ON the date are not listed. + self.assertNotIn("ON1", out) + self.assertNotIn("ON2", out) + self.assertNotIn("ON3", out) - # Assert that each task on 2015-07-07 is listed - for i in range(1,5): - self.assertNotIn("on due date {0}".format(i), out) + # Assert that tasks on other dates are listed. + self.assertIn("OFF4", out) + self.assertIn("OFF5", out) + self.assertIn("OFF6", out) + self.assertIn("OFF7", out) if __name__ == "__main__":