From 468f376bfc2cf3e09addac37cd144de56b5f93bf Mon Sep 17 00:00:00 2001 From: Anthony Nowell Date: Wed, 27 Sep 2017 01:53:35 -0600 Subject: implement basic match functionality --- testing/tests/matches.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 testing/tests/matches.rs (limited to 'testing/tests/matches.rs') diff --git a/testing/tests/matches.rs b/testing/tests/matches.rs new file mode 100644 index 0000000..4a55615 --- /dev/null +++ b/testing/tests/matches.rs @@ -0,0 +1,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"); +} -- cgit