summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCeleo <mattboulanger@fastmail.com>2020-10-04 11:01:48 -0700
committerDavid Peter <sharkdp@users.noreply.github.com>2020-10-04 21:31:19 +0200
commit74a2ef8138474fce5211ab6fb6cc96241e51e77a (patch)
tree1580ce8f36c9bbe77623c863ec25b7171bab2b10 /tests
parent88ea21b2762b3715d3816248953ed7f551cdaa7b (diff)
test: add Jinja2 syntax test file
Diffstat (limited to 'tests')
-rw-r--r--tests/syntax-tests/highlighted/Jinja2/template.jinja230
-rw-r--r--tests/syntax-tests/source/Jinja2/template.jinja230
2 files changed, 60 insertions, 0 deletions
diff --git a/tests/syntax-tests/highlighted/Jinja2/template.jinja2 b/tests/syntax-tests/highlighted/Jinja2/template.jinja2
new file mode 100644
index 00000000..d34c5347
--- /dev/null
+++ b/tests/syntax-tests/highlighted/Jinja2/template.jinja2
@@ -0,0 +1,30 @@
+{% extends 'base.jinja2' %}
+<h1>{% block title %}{% endblock %}</h1>
+{% for entry in entries %}
+ <span>Entry {{ loop.index }}</span>
+ {% if entry.show %}
+ <p>{{ entry.value }}</p>
+ {% else if false %}
+ <p>No value</p>
+ {% endif %}
+{% endfor %}
+{% set some_value = 123 %}
+ <div>{{ some_value | custom_filter }}, {{ some_value | abs }}</div>
+{% endset %}
+{{ some_dict['val'].val }}
+{# comment #}
+{#
+ longer comment
+ {{ value }}
+#}
+{% raw %}
+ {{ do not transform }}
+{% endraw %}
+{% macro some_macro(value) -%}
+ <p style="color: red;">{{ value }}</p>
+{%- endmacro %}
+{% if another_val is defined %}
+ <h3>{{ another_val }}</h3>
+{% else %}
+ <h3>Unknown</h3>
+{% endif %}
diff --git a/tests/syntax-tests/source/Jinja2/template.jinja2 b/tests/syntax-tests/source/Jinja2/template.jinja2
new file mode 100644
index 00000000..c87f3fba
--- /dev/null
+++ b/tests/syntax-tests/source/Jinja2/template.jinja2
@@ -0,0 +1,30 @@
+{% extends 'base.jinja2' %}
+<h1>{% block title %}{% endblock %}</h1>
+{% for entry in entries %}
+ <span>Entry {{ loop.index }}</span>
+ {% if entry.show %}
+ <p>{{ entry.value }}</p>
+ {% else if false %}
+ <p>No value</p>
+ {% endif %}
+{% endfor %}
+{% set some_value = 123 %}
+ <div>{{ some_value | custom_filter }}, {{ some_value | abs }}</div>
+{% endset %}
+{{ some_dict['val'].val }}
+{# comment #}
+{#
+ longer comment
+ {{ value }}
+#}
+{% raw %}
+ {{ do not transform }}
+{% endraw %}
+{% macro some_macro(value) -%}
+ <p style="color: red;">{{ value }}</p>
+{%- endmacro %}
+{% if another_val is defined %}
+ <h3>{{ another_val }}</h3>
+{% else %}
+ <h3>Unknown</h3>
+{% endif %}