From d0a3d51dcda1f4c0509f9e083e3d02c81d23776a Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 22 Aug 2017 20:22:33 +0200 Subject: Add test for basic macro use --- testing/tests/macro.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 testing/tests/macro.rs (limited to 'testing/tests') 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"); +} -- cgit