summaryrefslogtreecommitdiff
path: root/test/test_template.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-06 18:36:41 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-06 18:36:41 -0400
commit8cce6101ac97aa59023f23185a5e1160330a93be (patch)
tree17414b4c7ef48eec8055412b0f6b40e9479f420d /test/test_template.py
parent1b4d1fb7e8a33ce3f285a0bbd5b2a1407a75b96c (diff)
downloadmako-8cce6101ac97aa59023f23185a5e1160330a93be.tar.gz
- add the final patch for #146
Diffstat (limited to 'test/test_template.py')
-rw-r--r--test/test_template.py98
1 files changed, 98 insertions, 0 deletions
diff --git a/test/test_template.py b/test/test_template.py
index ba1f58e..6a617ef 100644
--- a/test/test_template.py
+++ b/test/test_template.py
@@ -882,6 +882,104 @@ class ControlTest(TemplateTest):
"",
filters=lambda s:s.strip()
)
+
+ def test_commented_blank_control_1(self):
+ self._do_memory_test(
+ """
+ % if True:
+ ## comment
+ % endif
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
+
+ def test_commented_blank_control_2(self):
+ self._do_memory_test(
+ """
+ % if True:
+ ## comment
+ % elif True:
+ ## comment
+ % endif
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
+
+ def test_commented_blank_control_3(self):
+ self._do_memory_test(
+ """
+ % if True:
+ ## comment
+ % else:
+ ## comment
+ % endif
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
+
+ def test_commented_blank_control_4(self):
+ self._do_memory_test(
+ """
+ % if True:
+ ## comment
+ % elif True:
+ ## comment
+ % else:
+ ## comment
+ % endif
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
+
+ def test_commented_blank_control_5(self):
+ self._do_memory_test(
+ """
+ % for x in range(10):
+ ## comment
+ % endfor
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
+
+ def test_commented_blank_control_6(self):
+ self._do_memory_test(
+ """
+ % while False:
+ ## comment
+ % endwhile
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
+
+ def test_commented_blank_control_7(self):
+ self._do_memory_test(
+ """
+ % try:
+ ## comment
+ % except:
+ ## comment
+ % endtry
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
+
+ def test_commented_blank_control_8(self):
+ self._do_memory_test(
+ """
+ % with open('x', 'w') as fp:
+ ## comment
+ % endwith
+ """,
+ "",
+ filters=lambda s:s.strip()
+ )
def test_multiline_control(self):
t = Template("""