aboutsummaryrefslogblamecommitdiffstats
path: root/testing/tests/operators.rs
blob: d58492e66bc41cd8a7b61f9d07260f39e8eadc42 (plain) (tree)
1
2
3
4
5
6
7






                           














                                                       

                                    





             

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


#[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(), "muldivmod");
}