mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
tests: Add tests for complex and-or queries
This commit is contained in:
parent
1f8eae0071
commit
f10d1432f3
1 changed files with 64 additions and 0 deletions
|
@ -1035,6 +1035,70 @@ class Test1634(TestCase):
|
|||
self.assertIn("OFF7", out)
|
||||
|
||||
|
||||
class TestBug1915(TestCase):
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
self.t = Task()
|
||||
self.t("add project:A thingA")
|
||||
self.t("add project:B thingB")
|
||||
self.t("add project:C thingC")
|
||||
|
||||
def test_complex_and_or_query_variant_one(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (1)"""
|
||||
code, out, err = self.t("rc.verbose:nothing '(project:A or project:B) and status:pending' all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
def test_complex_and_or_query_variant_two(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (2)"""
|
||||
code, out, err = self.t("rc.verbose:nothing '( project:A or project:B ) and status:pending' all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
def test_complex_and_or_query_variant_three(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (3)"""
|
||||
code, out, err = self.t("rc.verbose:nothing 'status:pending and (project:A or project:B)' all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
def test_complex_and_or_query_variant_four(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (4)"""
|
||||
code, out, err = self.t("rc.verbose:nothing 'status:pending and ( project:A or project:B )' all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
def test_complex_and_or_query_variant_five(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (5)"""
|
||||
code, out, err = self.t("rc.verbose:nothing status:pending and '(project:A or project:B)' all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
def test_complex_and_or_query_variant_six(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (6)"""
|
||||
code, out, err = self.t("rc.verbose:nothing status:pending and '( project:A or project:B )' all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
def test_complex_and_or_query_variant_seven(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (7)"""
|
||||
code, out, err = self.t("rc.verbose:nothing status:pending and \\( project:A or project:B \\) all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
def test_complex_and_or_query_variant_eight(self):
|
||||
"""1915: Make sure parser handles complex and-or queries correctly (8)"""
|
||||
code, out, err = self.t("rc.verbose:nothing status:pending and \\(project:A or project:B\\) all")
|
||||
self.assertIn("thingA", out)
|
||||
self.assertIn("thingB", out)
|
||||
self.assertNotIn("thingC", out)
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue