diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-04-23 13:36:26 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-04-23 13:40:39 +0200 |
commit | 4633dd989c58e7707f681c0ffd651c8b5336d5a9 (patch) | |
tree | f96eaa4fb09932c9e8e6be142802270a6b3b1f6c /testing | |
parent | 641940ef3805589e92b4520d4944ed66afc875fb (diff) | |
download | askama-4633dd989c58e7707f681c0ffd651c8b5336d5a9.tar.gz askama-4633dd989c58e7707f681c0ffd651c8b5336d5a9.tar.bz2 askama-4633dd989c58e7707f681c0ffd651c8b5336d5a9.zip |
Fix taking references of function arguments (fixes #311)
Diffstat (limited to '')
-rw-r--r-- | testing/tests/simple.rs | 10 |
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(), ""); +} |