aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/simple.rs
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tests/simple.rs')
-rw-r--r--testing/tests/simple.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index f0f0a26..55353f5 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -484,3 +484,17 @@ fn test_num_literals() {
"[90, -90, 90, 2, 56, 240, 10.5, 10.5, 100000000000, 105000000000]",
);
}
+
+#[derive(askama::Template)]
+#[template(source = "{% let word = s %}{{ word }}", ext = "html")]
+struct LetBorrow {
+ s: String,
+}
+
+#[test]
+fn test_let_borrow() {
+ let template = LetBorrow {
+ s: "hello".to_owned(),
+ };
+ assert_eq!(template.render().unwrap(), "hello")
+}