diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-03 16:44:54 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-03 16:44:54 +0100 |
commit | aa98f61fa78b2a81e47419feae188308d30bacf6 (patch) | |
tree | b9782fe6b3620d94e3edf8a5b9a3d458f5699e31 /testing/tests/simple.rs | |
parent | 24c5693de8acd454b3e6e3b95107ba7e7823d256 (diff) | |
download | askama-aa98f61fa78b2a81e47419feae188308d30bacf6.tar.gz askama-aa98f61fa78b2a81e47419feae188308d30bacf6.tar.bz2 askama-aa98f61fa78b2a81e47419feae188308d30bacf6.zip |
Discard trailing newlines from templates by default
This matches Jinja's behavior, and seems sensible.
Diffstat (limited to '')
-rw-r--r-- | testing/tests/simple.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 454c1e2..2f69c84 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -22,7 +22,7 @@ fn test_variables() { assert_eq!(s.render(), "hello world, foo\n\ with number: 42\n\ Iñtërnâtiônàlizætiøn is important\n\ - in vars too: Iñtërnâtiônàlizætiøn\n"); + in vars too: Iñtërnâtiônàlizætiøn"); } @@ -35,7 +35,7 @@ struct IfTemplate { #[test] fn test_if() { let s = IfTemplate { cond: true }; - assert_eq!(s.render(), "true\n"); + assert_eq!(s.render(), "true"); } @@ -48,7 +48,7 @@ struct ElseTemplate { #[test] fn test_else() { let s = ElseTemplate { cond: false }; - assert_eq!(s.render(), "false\n"); + assert_eq!(s.render(), "false"); } @@ -62,7 +62,7 @@ struct ElseIfTemplate { #[test] fn test_else_if() { let s = ElseIfTemplate { cond: false, check: true }; - assert_eq!(s.render(), "checked\n"); + assert_eq!(s.render(), "checked"); } @@ -77,7 +77,7 @@ fn test_for() { let s = ForTemplate { strings: vec!["A", "alfa", "1"], }; - assert_eq!(s.render(), "0. A\n1. alfa\n2. 1\n\n"); + assert_eq!(s.render(), "0. A\n1. alfa\n2. 1\n"); } @@ -88,7 +88,7 @@ struct LiteralsTemplate {} #[test] fn test_literals() { let s = LiteralsTemplate {}; - assert_eq!(s.render(), "a\n"); + assert_eq!(s.render(), "a"); } @@ -105,7 +105,7 @@ struct AttrTemplate { #[test] fn test_attr() { let t = AttrTemplate { inner: Holder { a: 5 } }; - assert_eq!(t.render(), "5\n"); + assert_eq!(t.render(), "5"); } @@ -118,7 +118,7 @@ struct OptionTemplate<'a> { #[test] fn test_option() { let some = OptionTemplate { var: Some("foo") }; - assert_eq!(some.render(), "some: foo\n"); + assert_eq!(some.render(), "some: foo"); let none = OptionTemplate { var: None }; - assert_eq!(none.render(), "none\n"); + assert_eq!(none.render(), "none"); } |