aboutsummaryrefslogtreecommitdiffstats
path: root/testing/templates
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/templates/if-coerce.html51
-rw-r--r--testing/templates/macro-short-circuit.html9
2 files changed, 60 insertions, 0 deletions
diff --git a/testing/templates/if-coerce.html b/testing/templates/if-coerce.html
new file mode 100644
index 0000000..e32c2fe
--- /dev/null
+++ b/testing/templates/if-coerce.html
@@ -0,0 +1,51 @@
+{% macro foo(b) -%}
+ {% if b %}t{% else %}f{% endif -%}
+{% endmacro -%}
+
+{% macro bar(b) -%}
+ {%- call foo(b) -%}
+{% endmacro -%}
+
+{% macro baz(b) -%}
+ {%- call bar(b) -%}
+{% endmacro -%}
+
+{% macro qux(b) -%}
+ {%- call baz(b) -%}
+{% endmacro -%}
+
+{%- call foo(false) -%}
+{%- call bar(true) -%}
+{%- call baz(false) -%}
+{%- call qux(true) -%}
+
+{%- call qux(true && false) -%}
+{%- call qux(false || true) -%}
+
+{%- call qux(self.t) -%}
+{%- call qux(self.f) -%}
+{%- call qux(self.f || self.t) -%}
+
+{%- if false -%}
+if
+{%- else if false || true -%}
+elseif
+{%- else -%}
+else
+{%- endif -%}
+
+{%- if true && false -%}
+if
+{%- else if false -%}
+elseif
+{%- else -%}
+else
+{%- endif -%}
+
+{%- if false || true -%}
+if
+{%- else if (true && false) -%}
+elseif
+{%- else -%}
+else
+{%- endif -%}
diff --git a/testing/templates/macro-short-circuit.html b/testing/templates/macro-short-circuit.html
new file mode 100644
index 0000000..4a19b86
--- /dev/null
+++ b/testing/templates/macro-short-circuit.html
@@ -0,0 +1,9 @@
+{% macro foo(b) -%}
+ {{ b }}
+{%- endmacro -%}
+{% call foo(true) -%}
+{% call foo(true && true) -%}
+{% call foo(true && true && true) -%}
+{% call foo(false) -%}
+{% call foo(false || true) -%}
+{% call foo(false || false || true) -%}