From 7ca40db7384cafcabe28a90b81f53c8753f612d5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 22 Nov 2014 14:03:30 -0500 Subject: [PATCH] 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. --- test/tw-1418.t | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/tw-1418.t b/test/tw-1418.t index 21f74e31d..99949f13d 100755 --- a/test/tw-1418.t +++ b/test/tw-1418.t @@ -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