aboutsummaryrefslogblamecommitdiffstats
path: root/testing/tests/matches.rs
blob: 4a556157714cce51205b6349833ca2c39ceed051 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                       
#[macro_use]
extern crate askama;

use askama::Template;

#[derive(Template)]
#[template(path = "match.html")]
struct MatchTemplate<'a> {
    item: Option<&'a str>,
}

#[test]
fn test_match_option() {
    let s = MatchTemplate {
        item: Some("foo"),
    };
    assert_eq!(s.render().unwrap(), "\n\nFound foo\n");
}