aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/rust_macro.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/tests/rust_macro.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/tests/rust_macro.rs b/testing/tests/rust_macro.rs
new file mode 100644
index 0000000..c6e97ce
--- /dev/null
+++ b/testing/tests/rust_macro.rs
@@ -0,0 +1,22 @@
+#[macro_use]
+extern crate askama;
+
+use askama::Template;
+
+macro_rules! hello {
+ ($name:expr) => {
+ "world"
+ }
+}
+
+#[derive(Template)]
+#[template(path = "rust-macros.html")]
+struct RustMacrosTemplate<'a> {
+ name: &'a str,
+}
+
+#[test]
+fn main() {
+ let template = RustMacrosTemplate { name: "foo" };
+ assert_eq!("Hello, world!", template.render().unwrap());
+}