From 4af73a868c7d35641f8a1bcd0a82f8c7db411d8d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 20 Oct 2017 10:09:50 +0200 Subject: Add support for array literals (fixes #59) --- testing/tests/simple.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'testing/tests/simple.rs') 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"); +} -- cgit