aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-15 07:46:57 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-15 07:47:02 +0200
commitfb11c175b27564a208148c0734200af0d981a0c8 (patch)
treec8cdf812bb8358849768a6bf45a2cb9e7aecf321 /testing/tests
parent34fd0c07de86ff338e261a6454bad88661c07b2e (diff)
downloadaskama-fb11c175b27564a208148c0734200af0d981a0c8.tar.gz
askama-fb11c175b27564a208148c0734200af0d981a0c8.tar.bz2
askama-fb11c175b27564a208148c0734200af0d981a0c8.zip
Add test for let blocks
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/vars.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/tests/vars.rs b/testing/tests/vars.rs
new file mode 100644
index 0000000..53e3397
--- /dev/null
+++ b/testing/tests/vars.rs
@@ -0,0 +1,16 @@
+#[macro_use]
+extern crate askama;
+
+use askama::Template;
+
+#[derive(Template)]
+#[template(path = "let.html")]
+struct LetTemplate<'a> {
+ s: &'a str,
+}
+
+#[test]
+fn test_let() {
+ let t = LetTemplate { s: "foo" };
+ assert_eq!(t.render().unwrap(), "foo");
+}