aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-22 20:22:33 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-22 20:22:33 +0200
commitd0a3d51dcda1f4c0509f9e083e3d02c81d23776a (patch)
treea16a7595a24d6c116187e392a7dbcff3e440c35b /testing/tests
parent26a000cd9e6ab48325fbd4990bf2a3d9e2100a67 (diff)
downloadaskama-d0a3d51dcda1f4c0509f9e083e3d02c81d23776a.tar.gz
askama-d0a3d51dcda1f4c0509f9e083e3d02c81d23776a.tar.bz2
askama-d0a3d51dcda1f4c0509f9e083e3d02c81d23776a.zip
Add test for basic macro use
Diffstat (limited to '')
-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");
+}