From 1e72f30c3ed6bcc4900695d0393019449805348f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 24 Mar 2007 15:07:53 +0000 Subject: - fix to lexing of <%docs> tag nested in other tags --- test/lexer.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/lexer.py') 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\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 + + <%def name="foo()"> + <%doc> + this is the foo func + + + """ + 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): -- cgit v1.2.3