Create separate test module for loops

This commit is contained in:
Dirkjan Ochtman 2017-03-07 07:39:42 +01:00
parent 18735c9644
commit a0a3e4018c
2 changed files with 18 additions and 15 deletions

18
testing/tests/loops.rs Normal file
View File

@ -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");
}

View File

@ -65,21 +65,6 @@ fn test_else_if() {
}
#[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");
}
#[derive(Template)]
#[template(path = "literals.html")]
struct LiteralsTemplate {}