aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/matches.rs
diff options
context:
space:
mode:
authorLibravatar Anthony Nowell <anowell@gmail.com>2017-09-27 01:53:35 -0600
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-11-02 14:55:10 +0100
commit468f376bfc2cf3e09addac37cd144de56b5f93bf (patch)
tree3a6e127bac7e6a2193739902ff60a16b12c51c12 /testing/tests/matches.rs
parent14beb21d0cef62ca47ad85617bd9460369a15b61 (diff)
downloadaskama-468f376bfc2cf3e09addac37cd144de56b5f93bf.tar.gz
askama-468f376bfc2cf3e09addac37cd144de56b5f93bf.tar.bz2
askama-468f376bfc2cf3e09addac37cd144de56b5f93bf.zip
implement basic match functionality
Diffstat (limited to 'testing/tests/matches.rs')
-rw-r--r--testing/tests/matches.rs18
1 files changed, 18 insertions, 0 deletions
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");
+}