From 9da8d1814a202a2f52b21c7771c12ba50b76a6d2 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Sun, 29 Apr 2012 12:24:14 -0700 Subject: Added failing test case for issue #114. --- pystache/tests/test_renderengine.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pystache/tests/test_renderengine.py b/pystache/tests/test_renderengine.py index cd8b191..667fa03 100644 --- a/pystache/tests/test_renderengine.py +++ b/pystache/tests/test_renderengine.py @@ -501,6 +501,22 @@ class RenderTests(unittest.TestCase, AssertStringMixin): context = {'person': 'Mom', 'test': (lambda text: text + " :)")} self._assert_render(u'Hi Mom :)', template, context) + def test_section__lambda__list(self): + """ + Check that lists of lambdas are processed correctly for sections. + + This test case is equivalent to a test submitted to the Mustache spec here: + + https://github.com/mustache/spec/pull/47 . + + """ + template = '<{{#lambdas}}foo{{/lambdas}}>' + context = {'foo': 'bar', + 'lambdas': [lambda text: "~{{%s}}~" % text, + lambda text: "#{{%s}}#" % text]} + + self._assert_render(u'<~bar~#bar#>', template, context) + def test_section__lambda__not_on_context_stack(self): """ Check that section lambdas are not pushed onto the context stack. -- cgit v1.2.1