mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 13:23:08 +02:00
Unit Tests
- Corrected escaping for a test, where '+' does not need to be escaped when added in a description, or when scanning output with '+ in string', but does need to be escaped when it is part of a regular expression, because it has regex semantics.
This commit is contained in:
parent
d5c937ba8c
commit
7ca40db738
1 changed files with 6 additions and 3 deletions
|
@ -76,12 +76,15 @@ class Test1418(TestCase):
|
||||||
self.search_task_pattern(description)
|
self.search_task_pattern(description)
|
||||||
|
|
||||||
def test_slash_plus_in_description(self):
|
def test_slash_plus_in_description(self):
|
||||||
"""Can add and search a task with (\+) in description"""
|
"""Can add and search a task with (+) in description"""
|
||||||
description = "foo\+"
|
description = "foo+"
|
||||||
self.add_search_task(description)
|
self.add_search_task(description)
|
||||||
self.find_in_list(description)
|
self.find_in_list(description)
|
||||||
self.search_task_pattern(description)
|
|
||||||
|
|
||||||
|
# Different from the other tests, because we want to escape the '+'
|
||||||
|
# in the regex, but not in the 'add' or 'list'
|
||||||
|
code, out, err = self.t(("/foo\\+/",))
|
||||||
|
self.assertIn(description, out)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from simpletap import TAPTestRunner
|
from simpletap import TAPTestRunner
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue