projects
/
ganeti-local
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
997f690
)
Add UnescapeAndSplit unittest for multi-escapes
author
Iustin Pop
<iustin@google.com>
Wed, 30 Nov 2011 09:33:52 +0000
(10:33 +0100)
committer
Iustin Pop
<iustin@google.com>
Wed, 30 Nov 2011 10:11:45 +0000
(11:11 +0100)
This would have caught the bug in the first place. Argh,
hand-generated test cases!
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
test/ganeti.utils.text_unittest.py
patch
|
blob
|
history
diff --git
a/test/ganeti.utils.text_unittest.py
b/test/ganeti.utils.text_unittest.py
index
de7511e
..
c2fc549
100755
(executable)
--- a/
test/ganeti.utils.text_unittest.py
+++ b/
test/ganeti.utils.text_unittest.py
@@
-335,6
+335,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):