changeset 3221:e9ab91483e02

wiki parser: add new test
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 09 Mar 2008 15:50:55 +0100
parents 8bfa8788da3d
children 2c314d55e45d
files MoinMoin/parser/_tests/test_text_moin_wiki.py
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/_tests/test_text_moin_wiki.py	Sun Mar 09 14:46:07 2008 +0100
+++ b/MoinMoin/parser/_tests/test_text_moin_wiki.py	Sun Mar 09 15:50:55 2008 +0100
@@ -579,6 +579,23 @@
             result = self.needle.search(html).group(1)
             assert result == expected
 
+class TestMacrosInOneLine(ParserTestCase):
+    """ Test macro formatting """
+    text = 'AAA %s AAA'
+    needle = re.compile(text % r'(.+)')
+    _tests = (
+        # test                              expected
+        (u'<<Verbatim(A)>><<Verbatim(a)>>', 'Aa'),
+        (u'<<Verbatim(A)>> <<Verbatim(a)>>', 'A a'),
+        )
+
+    def testMultipleMacrosInOneLine(self):
+        """ parser.wiki: multiple macros in one line and no linebreak """
+        for test, expected in self._tests:
+            html = self.parse(self.text % test)
+            result = self.needle.search(html).group(1)
+            assert result == expected
+
 
 coverage_modules = ['MoinMoin.parser.text_moin_wiki']