aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/ui/macro.rs
diff options
context:
space:
mode:
authorLibravatar Guillaume Gomez <guillaume1.gomez@gmail.com>2023-11-17 11:47:55 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-11-20 10:34:26 +0100
commitea7267dfc2914cdc340bae1a823c0660daef19e6 (patch)
tree654f4f8184145cfa3ef0e66684394d5ee98de351 /testing/tests/ui/macro.rs
parent70b5b14dc54f13dcc7df6ab685ee24f88bda8123 (diff)
downloadaskama-ea7267dfc2914cdc340bae1a823c0660daef19e6.tar.gz
askama-ea7267dfc2914cdc340bae1a823c0660daef19e6.tar.bz2
askama-ea7267dfc2914cdc340bae1a823c0660daef19e6.zip
Add UI tests for macros error message
Diffstat (limited to 'testing/tests/ui/macro.rs')
-rw-r--r--testing/tests/ui/macro.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/tests/ui/macro.rs b/testing/tests/ui/macro.rs
new file mode 100644
index 0000000..01c64bf
--- /dev/null
+++ b/testing/tests/ui/macro.rs
@@ -0,0 +1,27 @@
+use askama::Template;
+
+#[derive(Template)]
+#[template(source = "{%- macro thrice(param) -%}
+{{ param }}
+{%- endmacro -%}
+
+{%- call thrice(2, 3) -%}", ext = "html")]
+struct InvalidNumberOfArgs;
+
+#[derive(Template)]
+#[template(source = "{%- macro thrice(param, param2) -%}
+{{ param }} {{ param2 }}
+{%- endmacro -%}
+
+{%- call thrice() -%}", ext = "html")]
+struct InvalidNumberOfArgs2;
+
+#[derive(Template)]
+#[template(source = "{%- macro thrice() -%}
+{%- endmacro -%}
+
+{%- call thrice(1, 2) -%}", ext = "html")]
+struct InvalidNumberOfArgs3;
+
+fn main() {
+}