mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-29 22:11:17 +00:00
Add test for == operator
This commit is contained in:
parent
d1d34ec608
commit
4568c40ae4
1
testing/templates/eq.html
Normal file
1
testing/templates/eq.html
Normal file
@ -0,0 +1 @@
|
||||
{% if a == b %}t{% endif %}{% if a == c %}t{% else %}f{% endif %}
|
19
testing/tests/comparison.rs
Normal file
19
testing/tests/comparison.rs
Normal file
@ -0,0 +1,19 @@
|
||||
extern crate askama;
|
||||
#[macro_use]
|
||||
extern crate askama_derive;
|
||||
|
||||
use askama::Template;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "eq.html")]
|
||||
struct EqTemplate {
|
||||
a: usize,
|
||||
b: usize,
|
||||
c: usize,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_eq() {
|
||||
let t = EqTemplate { a: 1, b: 1, c: 2 };
|
||||
assert_eq!(t.render(), "tf\n");
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user