From a0a3e4018c9fe1d23e0b53651804939a2711edde Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 7 Mar 2017 07:39:42 +0100 Subject: Create separate test module for loops --- testing/tests/loops.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 testing/tests/loops.rs (limited to 'testing/tests/loops.rs') diff --git a/testing/tests/loops.rs b/testing/tests/loops.rs new file mode 100644 index 0000000..4776729 --- /dev/null +++ b/testing/tests/loops.rs @@ -0,0 +1,18 @@ +#[macro_use] +extern crate askama; + +use askama::Template; + +#[derive(Template)] +#[template(path = "for.html")] +struct ForTemplate<'a> { + strings: Vec<&'a str>, +} + +#[test] +fn test_for() { + let s = ForTemplate { + strings: vec!["A", "alfa", "1"], + }; + assert_eq!(s.render(), "0. A\n1. alfa\n2. 1\n"); +} -- cgit