diff options
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(), ""); +} |