diff MoinMoin/_tests/test_wikiutil.py @ 3815:dcd932f8c4ec

fix MoinMoinBugs/TypeErrorInWikiutils
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 03 Jul 2008 15:24:35 +0200
parents 124d0ef138aa
children d9de4fa12f23 30ffb215bf6e
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikiutil.py	Wed Jul 02 14:47:41 2008 +0200
+++ b/MoinMoin/_tests/test_wikiutil.py	Thu Jul 03 15:24:35 2008 +0200
@@ -297,6 +297,21 @@
             for val in result[2]:
                 assert val is None or isinstance(val, unicode)
 
+    def testDoubleNameValueSeparator(self):
+        tests = [
+                  # regular and quoting tests
+                  (u'd==4,=3 ',    ([], {u'd': u'=4', u'': u'3'}, [])),
+                  (u'===a,b,c,d',  ([], {u'': u'==a'}, [u'b', u'c', u'd'])),
+                  (u'a,b,===,c,d', ([u'a', u'b'], {u'': u'=='}, [u'c', u'd'])),
+                ]
+
+        def _check(a, e):
+            r = wikiutil.parse_quoted_separated(a)
+            assert r == e
+
+        for args, expected in tests:
+            yield _check, args, expected
+
     def testNoNameValue(self):
         abcd = [u'a', u'b', u'c', u'd']
         tests = [