Mercurial > genshi > genshi-test
diff markup/tests/template.py @ 134:df44110ca91d
* Improve the accuracy of line numbers for text nodes, so that reported errors about syntax or evaluation errors in expressions point to the right line (not quite perfect yet, though).
* Evaluation errors in expressions now include the original expression code in the traceback.
author | cmlenz |
---|---|
date | Sun, 06 Aug 2006 18:07:21 +0000 |
parents | e9259920db05 |
children | 56d534eb53f9 |
line wrap: on
line diff
--- a/markup/tests/template.py +++ b/markup/tests/template.py @@ -518,7 +518,6 @@ self.assertEqual('test.html', e.filename) if sys.version_info[:2] >= (2, 4): self.assertEqual(1, e.lineno) - # We don't really care about the offset here, do we? def test_expression_syntax_error(self): xml = """<p> @@ -532,6 +531,20 @@ if sys.version_info[:2] >= (2, 4): self.assertEqual(2, e.lineno) + def test_expression_syntax_error_multi_line(self): + xml = """<p><em></em> + + ${bar"} + + </p>""" + try: + tmpl = Template(xml, filename='test.html') + self.fail('Expected SyntaxError') + except TemplateSyntaxError, e: + self.assertEqual('test.html', e.filename) + if sys.version_info[:2] >= (2, 4): + self.assertEqual(3, e.lineno) + def test_markup_noescape(self): """ Verify that outputting context data that is a `Markup` instance is not