aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/macro.rs
diff options
context:
space:
mode:
authorLibravatar Guillaume Gomez <guillaume1.gomez@gmail.com>2023-12-05 11:30:48 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-12-07 09:10:32 +0100
commitb5797cba881cb11455ca9baa25be4573eb1f317e (patch)
tree08282140a365226880386db74a1974d112071b34 /testing/tests/macro.rs
parent736480c38b1a65ea344283ae05605ddc33086d5a (diff)
downloadaskama-b5797cba881cb11455ca9baa25be4573eb1f317e.tar.gz
askama-b5797cba881cb11455ca9baa25be4573eb1f317e.tar.bz2
askama-b5797cba881cb11455ca9baa25be4573eb1f317e.zip
Add macro test with only argument being passed as named
Diffstat (limited to 'testing/tests/macro.rs')
-rw-r--r--testing/tests/macro.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/tests/macro.rs b/testing/tests/macro.rs
index 0088f36..9b3c63d 100644
--- a/testing/tests/macro.rs
+++ b/testing/tests/macro.rs
@@ -123,3 +123,20 @@ fn test_named_argument() {
"
);
}
+
+#[derive(Template)]
+#[template(
+ source = r#"{% macro button(label) %}
+{{- label -}}
+{% endmacro %}
+
+{%- call button(label="hi") -%}
+"#,
+ ext = "html"
+)]
+struct OnlyNamedArgument;
+
+#[test]
+fn test_only_named_argument() {
+ assert_eq!(OnlyNamedArgument.render().unwrap(), "hi");
+}