aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/macro.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/tests/macro.rs b/testing/tests/macro.rs
new file mode 100644
index 0000000..320ca2c
--- /dev/null
+++ b/testing/tests/macro.rs
@@ -0,0 +1,16 @@
+#[macro_use]
+extern crate askama;
+
+use askama::Template;
+
+#[derive(Template)]
+#[template(path = "macro.html", print = "all")]
+struct MacroTemplate<'a> {
+ s: &'a str,
+}
+
+#[test]
+fn test_macro() {
+ let t = MacroTemplate { s: "foo" };
+ assert_eq!(t.render().unwrap(), "foo foo foo");
+}