aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2020-04-23 13:36:26 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2020-04-23 13:40:39 +0200
commit4633dd989c58e7707f681c0ffd651c8b5336d5a9 (patch)
treef96eaa4fb09932c9e8e6be142802270a6b3b1f6c /testing/tests
parent641940ef3805589e92b4520d4944ed66afc875fb (diff)
downloadaskama-4633dd989c58e7707f681c0ffd651c8b5336d5a9.tar.gz
askama-4633dd989c58e7707f681c0ffd651c8b5336d5a9.tar.bz2
askama-4633dd989c58e7707f681c0ffd651c8b5336d5a9.zip
Fix taking references of function arguments (fixes #311)
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/simple.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index 7db8cb4..7241005 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -392,3 +392,13 @@ mod without_import_on_derive {
assert_eq!(WithoutImport.render().unwrap(), "foo");
}
}
+
+#[derive(askama::Template)]
+#[template(source = "{% let s = String::new() %}{{ s }}", ext = "txt")]
+struct DefineStringVar;
+
+#[test]
+fn test_define_string_var() {
+ let template = DefineStringVar;
+ assert_eq!(template.render().unwrap(), "");
+}