blob: 70d26b1eadeb5500dfd4e52d4043f1b490276840 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
extern crate askama;
#[macro_use]
extern crate askama_derive;
use askama::Template;
#[derive(Template)]
#[template(path = "compare.html")]
struct CompareTemplate {
a: usize,
b: usize,
c: usize,
}
#[test]
fn test_compare() {
let t = CompareTemplate { a: 1, b: 1, c: 2 };
assert_eq!(t.render(), "tf\ntf\ntf\ntf\ntf\ntf");
}
#[derive(Template)]
#[template(path = "operators.html")]
struct OperatorsTemplate {
a: usize,
b: usize,
c: usize,
}
#[test]
fn test_operators() {
let t = OperatorsTemplate { a: 1, b: 1, c: 2 };
assert_eq!(t.render(), "muldivmodaddrshlshbandbxorborandor");
}
|