diff options
author | Christian Vallentin <mail@vallentin.dev> | 2020-12-12 18:01:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 18:01:22 +0100 |
commit | 3b57663b5b626a322e81f9399f0ab39a88411fd4 (patch) | |
tree | fa9ee7c09dd869a4183d012006f59215e39e07a8 /testing/tests/matches.rs | |
parent | 5b01e605914a49f0b9e71e7dbe7c17ef1de2c522 (diff) | |
download | askama-3b57663b5b626a322e81f9399f0ab39a88411fd4.tar.gz askama-3b57663b5b626a322e81f9399f0ab39a88411fd4.tar.bz2 askama-3b57663b5b626a322e81f9399f0ab39a88411fd4.zip |
Fixed whitespace issue when generating match (#399)
* Fixed #397
* Updated parser to ignore whitespace between match and when
* Updated test cases
* Updated Python script to generate match ws tests
* Added match ws tests
* Resolved rustfmt lint
Diffstat (limited to 'testing/tests/matches.rs')
-rw-r--r-- | testing/tests/matches.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/testing/tests/matches.rs b/testing/tests/matches.rs index 811f3ce..d75a6c4 100644 --- a/testing/tests/matches.rs +++ b/testing/tests/matches.rs @@ -17,19 +17,19 @@ struct MatchOptRefTemplate<'a> { #[test] fn test_match_option() { let s = MatchOptTemplate { item: Some("foo") }; - assert_eq!(s.render().unwrap(), "\n\nFound literal foo\n"); + assert_eq!(s.render().unwrap(), "\nFound literal foo\n"); let s = MatchOptTemplate { item: Some("bar") }; - assert_eq!(s.render().unwrap(), "\n\nFound bar\n"); + assert_eq!(s.render().unwrap(), "\nFound bar\n"); let s = MatchOptTemplate { item: None }; - assert_eq!(s.render().unwrap(), "\n\nNot Found\n"); + assert_eq!(s.render().unwrap(), "\nNot Found\n"); } #[test] fn test_match_ref_deref() { let s = MatchOptRefTemplate { item: &Some("foo") }; - assert_eq!(s.render().unwrap(), "\n\nFound literal foo\n"); + assert_eq!(s.render().unwrap(), "\nFound literal foo\n"); } #[derive(Template)] @@ -41,10 +41,10 @@ struct MatchLitTemplate<'a> { #[test] fn test_match_literal() { let s = MatchLitTemplate { item: "bar" }; - assert_eq!(s.render().unwrap(), "\n\nFound literal bar\n"); + assert_eq!(s.render().unwrap(), "\nFound literal bar\n"); let s = MatchLitTemplate { item: "qux" }; - assert_eq!(s.render().unwrap(), "\n\nElse found qux\n"); + assert_eq!(s.render().unwrap(), "\nElse found qux\n"); } #[derive(Template)] @@ -56,10 +56,10 @@ struct MatchLitCharTemplate { #[test] fn test_match_literal_char() { let s = MatchLitCharTemplate { item: 'b' }; - assert_eq!(s.render().unwrap(), "\n\nFound literal b\n"); + assert_eq!(s.render().unwrap(), "\nFound literal b\n"); let s = MatchLitCharTemplate { item: 'c' }; - assert_eq!(s.render().unwrap(), "\n\nElse found c\n"); + assert_eq!(s.render().unwrap(), "\nElse found c\n"); } #[derive(Template)] @@ -71,10 +71,10 @@ struct MatchLitNumTemplate { #[test] fn test_match_literal_num() { let s = MatchLitNumTemplate { item: 42 }; - assert_eq!(s.render().unwrap(), "\n\nFound answer to everything\n"); + assert_eq!(s.render().unwrap(), "\nFound answer to everything\n"); let s = MatchLitNumTemplate { item: 23 }; - assert_eq!(s.render().unwrap(), "\n\nElse found 23\n"); + assert_eq!(s.render().unwrap(), "\nElse found 23\n"); } #[allow(dead_code)] @@ -99,7 +99,7 @@ fn test_match_custom_enum() { b: 255, }, }; - assert_eq!(s.render().unwrap(), "\n\nColorful: #A000FF\n"); + assert_eq!(s.render().unwrap(), "\nColorful: #A000FF\n"); } #[derive(Template)] |