Commit e7f7212b authored by Iustin Pop's avatar Iustin Pop Committed by Michael Hanselmann
Browse files

Add UnescapeAndSplit unittest for multi-escapes



This would have caught the bug in the first place. Argh,
hand-generated test cases!
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent ecabe27e
......@@ -387,6 +387,12 @@ class TestUnescapeAndSplit(unittest.TestCase):
b = [sep, sep, "c", "d.moo\\"]
self.assertEqual(utils.UnescapeAndSplit("%s\\" % sep.join(a), sep=sep), b)
def testMultipleEscapes(self):
for sep in self._seps:
a = ["a", "b\\" + sep + "c", "d\\" + sep + "e\\" + sep + "f", "g"]
b = ["a", "b" + sep + "c", "d" + sep + "e" + sep + "f", "g"]
self.failUnlessEqual(utils.UnescapeAndSplit(sep.join(a), sep=sep), b)
class TestCommaJoin(unittest.TestCase):
def test(self):
......
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