From cfb827770faab9cebf61daae1838f720926d224d Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 11 Sep 2015 07:39:11 +0200 Subject: [PATCH] tests: Add test for TW-1656 --- test/filter.t | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/filter.t b/test/filter.t index 56adcfa4e..fc7eff4ef 100755 --- a/test/filter.t +++ b/test/filter.t @@ -702,6 +702,28 @@ class TestBug1600(TestCase): self.assertNotIn("[foobar2]", out) +class TestBug1656(TestCase): + def setUp(self): + self.t = Task() + + def test_report_filter_parenthesized(self): + """default report filter parenthesized""" + self.t('add task1 +work') + self.t('add task2 +work') + self.t('1 done') + + # Sanity check, next does not display completed tasks + code, out, err = self.t("next") + self.assertNotIn("task1", out) + self.assertIn("task2", out) + + # The or in the filter should not cause ignoring the implicit + # report filter + code, out, err = self.t("next +home or +work") + self.assertNotIn("task1", out) + self.assertIn("task2", out) + + if __name__ == "__main__": from simpletap import TAPTestRunner unittest.main(testRunner=TAPTestRunner())