aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/templates/let.html1
-rw-r--r--testing/tests/vars.rs16
2 files changed, 17 insertions, 0 deletions
diff --git a/testing/templates/let.html b/testing/templates/let.html
new file mode 100644
index 0000000..5b19255
--- /dev/null
+++ b/testing/templates/let.html
@@ -0,0 +1 @@
+{% let v = s %}{{ v }}
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");
+}