diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-07 07:39:42 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-07 07:39:42 +0100 |
commit | a0a3e4018c9fe1d23e0b53651804939a2711edde (patch) | |
tree | 57bad47d82d0ea6cb697568d0f49a712a2b3e15a /testing/tests/loops.rs | |
parent | 18735c964456e2333fbdee236ee12269360e2c97 (diff) | |
download | askama-a0a3e4018c9fe1d23e0b53651804939a2711edde.tar.gz askama-a0a3e4018c9fe1d23e0b53651804939a2711edde.tar.bz2 askama-a0a3e4018c9fe1d23e0b53651804939a2711edde.zip |
Create separate test module for loops
Diffstat (limited to 'testing/tests/loops.rs')
-rw-r--r-- | testing/tests/loops.rs | 18 |
1 files changed, 18 insertions, 0 deletions
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"); +} |