From 07e9b307c88d33900f1843239582edc0ac546c4a Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 7 Sep 2017 20:42:54 +0200 Subject: Move escaping tests into a separate module --- testing/tests/simple.rs | 52 ------------------------------------------------- 1 file changed, 52 deletions(-) (limited to 'testing') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index a05b956..93faf50 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -181,55 +181,3 @@ fn test_composition() { let t = CompositionTemplate { foo: IfTemplate { cond: true } }; assert_eq!(t.render().unwrap(), "composed: true"); } - - -#[derive(Template)] -#[template(source = "{{ foo }}", ext = "html")] -struct ImplicitEscapedTemplate<'a> { - foo: &'a str, -} - -#[test] -fn test_implicit_escaped() { - let t = ImplicitEscapedTemplate { foo: "foo & bar" }; - assert_eq!(t.render().unwrap(), "foo & bar"); -} - - -#[derive(Template)] -#[template(source = "{{ foo }}", ext = "html", escape = "html")] -struct ExplicitEscapedTemplate<'a> { - foo: &'a str, -} - -#[test] -fn test_explicit_escaped() { - let t = ExplicitEscapedTemplate { foo: "foo & bar" }; - assert_eq!(t.render().unwrap(), "foo & bar"); -} - - -#[derive(Template)] -#[template(source = "{{ foo }}", ext = "txt")] -struct UnescapedTemplate<'a> { - foo: &'a str, -} - -#[test] -fn test_unescaped() { - let t = UnescapedTemplate { foo: "foo & bar" }; - assert_eq!(t.render().unwrap(), "foo & bar"); -} - - -#[derive(Template)] -#[template(path = "hello.html")] -struct PathBasedEscapedTemplate<'a> { - name: &'a str, -} - -#[test] -fn test_path_based_escaped() { - let t = PathBasedEscapedTemplate { name: "you & me" }; - assert_eq!(t.render().unwrap(), "Hello, you & me!"); -} -- cgit