Commit 380c1112 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Don't use OrdinalTagFilter when the value in the condition is empty.

When an expression 'due:' is used, it should be treated as a normal
filter and not as an OrdinalTagFilter.
parent a4773279
......@@ -145,6 +145,14 @@ class ListCommandTest(CommandTest.CommandTest):
self.assertEquals(self.output, " 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list16(self):
command = ListCommand(["-x", "id:"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, " 3 (C) Baz @Context1 +Project1 key:value id:1\n")
self.assertEquals(self.errors, "")
def test_help(self):
command = ListCommand(["help"], self.todolist, self.out, self.error)
command.execute()
......
......@@ -152,7 +152,7 @@ class LimitFilter(Filter):
def filter(self, p_todos):
return p_todos[:self.limit] if self.limit >= 0 else p_todos
ORDINAL_TAG_MATCH = r"(?P<key>[^:]*):(?P<operator><=?|=|>=?|!)?(?P<value>\S*)"
ORDINAL_TAG_MATCH = r"(?P<key>[^:]*):(?P<operator><=?|=|>=?|!)?(?P<value>\S+)"
class OrdinalTagFilter(Filter):
def __init__(self, p_expression):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment