aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/templates/macro-self-arg.html5
-rw-r--r--testing/tests/macro.rs12
2 files changed, 17 insertions, 0 deletions
diff --git a/testing/templates/macro-self-arg.html b/testing/templates/macro-self-arg.html
new file mode 100644
index 0000000..c7c6d5b
--- /dev/null
+++ b/testing/templates/macro-self-arg.html
@@ -0,0 +1,5 @@
+{%- macro my_s(slf) -%}
+ {{ slf.s }}
+{%- endmacro -%}
+
+{%- call my_s(self) -%}
diff --git a/testing/tests/macro.rs b/testing/tests/macro.rs
index 7e910a9..faada37 100644
--- a/testing/tests/macro.rs
+++ b/testing/tests/macro.rs
@@ -83,3 +83,15 @@ fn str_cmp() {
let t = StrCmpTemplate;
assert_eq!(t.render().unwrap(), "AfooBotherCneitherD");
}
+
+#[derive(Template)]
+#[template(path = "macro-self-arg.html")]
+struct MacroSelfArgTemplate<'a> {
+ s: &'a str,
+}
+
+#[test]
+fn test_macro_self_arg() {
+ let t = MacroSelfArgTemplate { s: "foo" };
+ assert_eq!(t.render().unwrap(), "foo");
+}