aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/ui
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tests/ui')
-rw-r--r--testing/tests/ui/name_mismatch_endblock.rs8
-rw-r--r--testing/tests/ui/name_mismatch_endblock.stderr8
-rw-r--r--testing/tests/ui/name_mismatch_endmacro.rs8
-rw-r--r--testing/tests/ui/name_mismatch_endmacro.stderr8
4 files changed, 32 insertions, 0 deletions
diff --git a/testing/tests/ui/name_mismatch_endblock.rs b/testing/tests/ui/name_mismatch_endblock.rs
new file mode 100644
index 0000000..9fbfbe4
--- /dev/null
+++ b/testing/tests/ui/name_mismatch_endblock.rs
@@ -0,0 +1,8 @@
+use askama::Template;
+
+#[derive(Template)]
+#[template(source = "{% block foo %}{% endblock not_foo %}", ext = "html")]
+struct NameMismatchEndBlock;
+
+fn main() {
+}
diff --git a/testing/tests/ui/name_mismatch_endblock.stderr b/testing/tests/ui/name_mismatch_endblock.stderr
new file mode 100644
index 0000000..2cd7aaf
--- /dev/null
+++ b/testing/tests/ui/name_mismatch_endblock.stderr
@@ -0,0 +1,8 @@
+error: problems parsing template source at row 1, column 27 near:
+ "not_foo %}"
+ --> tests/ui/name_mismatch_endblock.rs:3:10
+ |
+3 | #[derive(Template)]
+ | ^^^^^^^^
+ |
+ = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/testing/tests/ui/name_mismatch_endmacro.rs b/testing/tests/ui/name_mismatch_endmacro.rs
new file mode 100644
index 0000000..10ea31f
--- /dev/null
+++ b/testing/tests/ui/name_mismatch_endmacro.rs
@@ -0,0 +1,8 @@
+use askama::Template;
+
+#[derive(Template)]
+#[template(source = "{% macro foo(arg) %} {{arg}} {% endmacro not_foo %}", ext = "html")]
+struct NameMismatchEndMacro;
+
+fn main() {
+}
diff --git a/testing/tests/ui/name_mismatch_endmacro.stderr b/testing/tests/ui/name_mismatch_endmacro.stderr
new file mode 100644
index 0000000..ef389a2
--- /dev/null
+++ b/testing/tests/ui/name_mismatch_endmacro.stderr
@@ -0,0 +1,8 @@
+error: problems parsing template source at row 1, column 41 near:
+ "not_foo %}"
+ --> tests/ui/name_mismatch_endmacro.rs:3:10
+ |
+3 | #[derive(Template)]
+ | ^^^^^^^^
+ |
+ = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)