mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-30 22:41:13 +00:00
Create separate test module for loops
This commit is contained in:
parent
18735c9644
commit
a0a3e4018c
18
testing/tests/loops.rs
Normal file
18
testing/tests/loops.rs
Normal 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");
|
||||
}
|
@ -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 {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user