aboutsummaryrefslogtreecommitdiffstats
path: root/test/lexer.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-03-24 15:07:53 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-03-24 15:07:53 +0000
commit1e72f30c3ed6bcc4900695d0393019449805348f (patch)
treea21d025a9137df4a9e368eb16f71e558742c25f3 /test/lexer.py
parent15350f3bea2d110d65e42a026c2ff853b11f9b15 (diff)
downloadexternal_python_mako-1e72f30c3ed6bcc4900695d0393019449805348f.tar.gz
external_python_mako-1e72f30c3ed6bcc4900695d0393019449805348f.tar.bz2
external_python_mako-1e72f30c3ed6bcc4900695d0393019449805348f.zip
- fix to lexing of <%docs> tag nested in other tags
Diffstat (limited to 'test/lexer.py')
-rw-r--r--test/lexer.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lexer.py b/test/lexer.py
index 7e13edd..fd8ea75 100644
--- a/test/lexer.py
+++ b/test/lexer.py
@@ -398,6 +398,20 @@ hi
"""
nodes = Lexer(template).parse()
assert repr(nodes) == r"""TemplateNode({}, [Text(u'\n<style>\n #someselector\n # other non comment stuff\n</style>\n', (1, 1)), Comment(u'a comment', (6, 1)), Text(u'\n# also not a comment\n\n', (7, 1)), Comment(u'this is a comment', (10, 1)), Text(u' \nthis is ## not a comment\n\n', (11, 1)), Comment(u' multiline\ncomment\n', (14, 1)), Text(u'\n\nhi\n', (16, 8))])"""
+
+ def test_docs(self):
+ template = """
+ <%doc>
+ this is a comment
+ </%doc>
+ <%def name="foo()">
+ <%doc>
+ this is the foo func
+ </%doc>
+ </%def>
+ """
+ nodes = Lexer(template).parse()
+ assert repr(nodes) == r"""TemplateNode({}, [Text(u'\n ', (1, 1)), Comment(u'\n this is a comment\n ', (2, 9)), Text(u'\n ', (4, 16)), DefTag(u'def', {u'name': u'foo()'}, (5, 9), ["Text(u'\\n ', (5, 28))", "Comment(u'\\n this is the foo func\\n ', (6, 13))", "Text(u'\\n ', (8, 20))"]), Text(u'\n ', (9, 16))])"""
def test_preprocess(self):
def preproc(text):