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:
Paul Beckingham 2014-11-22 14:03:30 -05:00
parent d5c937ba8c
commit 7ca40db738

View file

@ -76,12 +76,15 @@ class Test1418(TestCase):
self.search_task_pattern(description)
def test_slash_plus_in_description(self):
"""Can add and search a task with (\+) in description"""
description = "foo\+"
"""Can add and search a task with (+) in description"""
description = "foo+"
self.add_search_task(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__":
from simpletap import TAPTestRunner