diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-10-20 10:09:50 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-10-20 10:09:50 +0200 |
commit | 4af73a868c7d35641f8a1bcd0a82f8c7db411d8d (patch) | |
tree | 1161aad02f2e453c1f800bc6a1730fbfb8bea671 /testing/tests/simple.rs | |
parent | 3d9048ab50b1030ff741371ed0d853fcc3ab5780 (diff) | |
download | askama-4af73a868c7d35641f8a1bcd0a82f8c7db411d8d.tar.gz askama-4af73a868c7d35641f8a1bcd0a82f8c7db411d8d.tar.bz2 askama-4af73a868c7d35641f8a1bcd0a82f8c7db411d8d.zip |
Add support for array literals (fixes #59)
Diffstat (limited to 'testing/tests/simple.rs')
-rw-r--r-- | testing/tests/simple.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index fd30499..bee5690 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -184,3 +184,14 @@ fn test_path_compare() { let t = PathCompareTemplate { x: Alphabet::Alpha }; assert_eq!(t.render().unwrap(), "true"); } + + +#[derive(Template)] +#[template(source = "{% for i in [1, 2] %}{{ i }}{% endfor %}", ext = "txt")] +struct ArrayTemplate {} + +#[test] +fn test_slice_literal() { + let t = ArrayTemplate {}; + assert_eq!(t.render().unwrap(), "12"); +} |