aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/matches.rs
diff options
context:
space:
mode:
authorLibravatar Tuomas Siipola <tuomas@zpl.fi>2020-01-03 20:36:17 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2020-01-03 19:56:18 +0100
commitcef055108de6c51c1423cd6a8919730ef01f64a3 (patch)
tree1e2d2bbac73110453388b13ba781a1101803a37b /testing/tests/matches.rs
parent2446315d38882efe43a31a3749481eac9b25615d (diff)
downloadaskama-cef055108de6c51c1423cd6a8919730ef01f64a3.tar.gz
askama-cef055108de6c51c1423cd6a8919730ef01f64a3.tar.bz2
askama-cef055108de6c51c1423cd6a8919730ef01f64a3.zip
Support char literals
Diffstat (limited to 'testing/tests/matches.rs')
-rw-r--r--testing/tests/matches.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/tests/matches.rs b/testing/tests/matches.rs
index 3e6d636..811f3ce 100644
--- a/testing/tests/matches.rs
+++ b/testing/tests/matches.rs
@@ -48,6 +48,21 @@ fn test_match_literal() {
}
#[derive(Template)]
+#[template(path = "match-literal-char.html")]
+struct MatchLitCharTemplate {
+ item: char,
+}
+
+#[test]
+fn test_match_literal_char() {
+ let s = MatchLitCharTemplate { item: 'b' };
+ assert_eq!(s.render().unwrap(), "\n\nFound literal b\n");
+
+ let s = MatchLitCharTemplate { item: 'c' };
+ assert_eq!(s.render().unwrap(), "\n\nElse found c\n");
+}
+
+#[derive(Template)]
#[template(path = "match-literal-num.html")]
struct MatchLitNumTemplate {
item: u32,