aboutsummaryrefslogtreecommitdiff
path: root/test/data
diff options
context:
space:
mode:
Diffstat (limited to 'test/data')
-rw-r--r--test/data/html-extend/base.txt11
-rw-r--r--test/data/html-extend/data.json12
-rw-r--r--test/data/html-extend/inter.txt3
-rw-r--r--test/data/html-extend/result.txt11
-rw-r--r--test/data/html-extend/template.txt7
-rwxr-xr-xtest/data/include-both.txt1
6 files changed, 45 insertions, 0 deletions
diff --git a/test/data/html-extend/base.txt b/test/data/html-extend/base.txt
new file mode 100644
index 0000000..e301c7a
--- /dev/null
+++ b/test/data/html-extend/base.txt
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ {% block head -%}
+ <title>{% block title %}Default - {% endblock %}</title>
+ {%- endblock -%}
+</head>
+<body>
+ {% block body %}ignored{% endblock %}
+</body>
+</html>
diff --git a/test/data/html-extend/data.json b/test/data/html-extend/data.json
new file mode 100644
index 0000000..c5726a5
--- /dev/null
+++ b/test/data/html-extend/data.json
@@ -0,0 +1,12 @@
+{
+ "author": "Pantor",
+ "date": "23/12/2018",
+ "tags": [
+ "test",
+ "templates"
+ ],
+ "views": 123,
+ "title": "Inja works.",
+ "content": "Inja is the best and fastest template engine for C++. Period.",
+ "footer-text": "This is the footer."
+}
diff --git a/test/data/html-extend/inter.txt b/test/data/html-extend/inter.txt
new file mode 100644
index 0000000..d20d97b
--- /dev/null
+++ b/test/data/html-extend/inter.txt
@@ -0,0 +1,3 @@
+{% extends "base.txt" %}
+{% block title %}Inter {{ author }}{% endblock %}
+{% block body %}<main>Intermediate Content</main>{% endblock %} \ No newline at end of file
diff --git a/test/data/html-extend/result.txt b/test/data/html-extend/result.txt
new file mode 100644
index 0000000..6d99e29
--- /dev/null
+++ b/test/data/html-extend/result.txt
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Default - Inter Pantor: Inja works.</title>
+
+ <style type="text/css">.important { color: #336699; }</style>
+</head>
+<body>
+ <main>Inja is the best and fastest template engine for C++. Period.</main>
+</body>
+</html>
diff --git a/test/data/html-extend/template.txt b/test/data/html-extend/template.txt
new file mode 100644
index 0000000..18eeb5d
--- /dev/null
+++ b/test/data/html-extend/template.txt
@@ -0,0 +1,7 @@
+{% extends "inter.txt" %}
+{% block head -%}
+ {{ super(2) }}
+ <style type="text/css">.important { color: #336699; }</style>
+{%- endblock %}
+{% block title %}{{ super(2) }}{{ super() }}: {{ title }}{% endblock %}
+{% block body %}<main>{{ content }}</main>{% endblock %}
diff --git a/test/data/include-both.txt b/test/data/include-both.txt
new file mode 100755
index 0000000..cbdc374
--- /dev/null
+++ b/test/data/include-both.txt
@@ -0,0 +1 @@
+{% include "simple.txt" %} - {% include "body" %} \ No newline at end of file