From b5797cba881cb11455ca9baa25be4573eb1f317e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 5 Dec 2023 11:30:48 +0100 Subject: Add macro test with only argument being passed as named --- testing/tests/macro.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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"); +} -- cgit