Browse Source

Tests for self-recursive blocks.

Might have been nice to get some kind of warning or hint,
but at least it doesn't crash.

This closes #112.
Andreas Stenius 11 years ago
parent
commit
819f9aae98

+ 3 - 0
tests/expect/extend_recursive_block

@@ -0,0 +1,3 @@
+
+    extended content
+

+ 6 - 0
tests/expect/recursive_block

@@ -0,0 +1,6 @@
+
+    testing: <br />
+    
+    <br />
+    end testing<br />
+

+ 5 - 0
tests/input/extend_recursive_block

@@ -0,0 +1,5 @@
+{% extends "recursive_block" %}
+
+{% block content %}
+    extended content
+{% endblock %}

+ 6 - 0
tests/input/recursive_block

@@ -0,0 +1,6 @@
+{% block content %}
+    testing: <br />
+    {% block content %}{% endblock %}
+    <br />
+    end testing<br />
+{% endblock %}

+ 6 - 5
tests/src/erlydtl_functional_tests.erl

@@ -44,11 +44,12 @@ test_list() ->
      "for_tuple", "for_list_preset", "for_preset", "for_records",
      "for_records_preset", "include", "if", "if_preset", "ifequal",
      "ifequal_preset", "ifnotequal", "ifnotequal_preset", "now",
-     "var", "var_preset", "cycle",
-     "custom_tag", "custom_tag1", "custom_tag2", "custom_tag3", "custom_tag4",
-     "custom_call",
-     "include_template", "include_path", "ssi",
-     "extends_path", "extends_path2", "trans", "extends2", "extends3" ].
+     "var", "var_preset", "cycle", "custom_tag", "custom_tag1",
+     "custom_tag2", "custom_tag3", "custom_tag4", "custom_call",
+     "include_template", "include_path", "ssi", "extends_path",
+     "extends_path2", "trans", "extends2", "extends3",
+     "recursive_block", "extend_recursive_block"
+    ].
 
 setup_compile("for_list_preset") ->
     CompileVars = [{fruit_list, [["apple", "apples"], ["banana", "bananas"], ["coconut", "coconuts"]]}],