diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-02-02 11:41:34 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-02-02 11:41:34 -0500 |
| commit | 1efbc0327aa00b5bdda724c9e76094826ae15a3f (patch) | |
| tree | 49cd631f9c35bd9a165c13eeed9f34f770c06328 /test/test_lexer.py | |
| parent | ea3d1f2cf158d4ce5dd36ce79806058faddb8c48 (diff) | |
| download | external_python_mako-1efbc0327aa00b5bdda724c9e76094826ae15a3f.tar.gz external_python_mako-1efbc0327aa00b5bdda724c9e76094826ae15a3f.tar.bz2 external_python_mako-1efbc0327aa00b5bdda724c9e76094826ae15a3f.zip | |
Fix for [ticket:20] and [ticket:86] much thanks to Eevee
Diffstat (limited to 'test/test_lexer.py')
| -rw-r--r-- | test/test_lexer.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_lexer.py b/test/test_lexer.py index 538da97..61204ff 100644 --- a/test/test_lexer.py +++ b/test/test_lexer.py @@ -557,6 +557,23 @@ print(''' False, (1, 1)), Text(u" '''and now some text '''", (10,11))])) + def test_tricky_code_4(self): + template = \ + """<% foo = "\\"\\\\" %>""" + nodes = Lexer(template).parse() + self._compare(nodes, TemplateNode({}, + [Code(u"""foo = "\\"\\\\" \n""", + False, (1, 1))])) + + def test_tricky_code_5(self): + template = \ + """before ${ {'key': 'value'} } after""" + nodes = Lexer(template).parse() + self._compare(nodes, TemplateNode({}, + [Text(u'before ', (1, 1)), + Expression(u" {'key': 'value'} ", [], (1, 8)), + Text(u' after', (1, 29))])) + def test_control_lines(self): template = \ """ |
