diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-04-17 17:34:44 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-04-17 17:34:44 +0200 |
commit | 8d8374a10f09729b403f3519a7bceac919c484c3 (patch) | |
tree | b2e2e7bc5233f1e6cfc1148b68d486a89f600ed6 /testing | |
parent | 02266bed683080e6412c337251d69df23b5da3c6 (diff) | |
download | askama-8d8374a10f09729b403f3519a7bceac919c484c3.tar.gz askama-8d8374a10f09729b403f3519a7bceac919c484c3.tar.bz2 askama-8d8374a10f09729b403f3519a7bceac919c484c3.zip |
Properly handle whitespace around comments (fixes #79)
Diffstat (limited to 'testing')
-rw-r--r-- | testing/tests/simple.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 4ed1261..c9c3c0c 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -196,3 +196,14 @@ fn test_slice_literal() { let t = ArrayTemplate {}; assert_eq!(t.render().unwrap(), "a"); } + + +#[derive(Template)] +#[template(source = " {# foo -#} ", ext = "txt")] +struct CommentTemplate {} + +#[test] +fn test_comment() { + let t = CommentTemplate {}; + assert_eq!(t.render().unwrap(), " "); +} |