Add test for == operator

This commit is contained in:
Dirkjan Ochtman 2017-02-04 21:38:59 +01:00
parent d1d34ec608
commit 4568c40ae4
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1 @@
{% if a == b %}t{% endif %}{% if a == c %}t{% else %}f{% endif %}

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