aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/simple.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/tests/simple.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index 53f1122..a075d26 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -122,6 +122,19 @@ fn test_literals() {
assert_eq!(s.render().unwrap(), "a\na\ntrue\nfalse");
}
+#[derive(Template)]
+#[template(path = "literals-escape.html")]
+struct LiteralsEscapeTemplate {}
+
+#[test]
+fn test_literals_escape() {
+ let s = LiteralsEscapeTemplate {};
+ assert_eq!(
+ s.render().unwrap(),
+ "A\n\r\t\\\0♥'""\nA\n\r\t\\\0♥'"'"
+ );
+}
+
struct Holder {
a: usize,
}