From 8d8374a10f09729b403f3519a7bceac919c484c3 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 17 Apr 2018 17:34:44 +0200 Subject: Properly handle whitespace around comments (fixes #79) --- testing/tests/simple.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'testing/tests/simple.rs') 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(), " "); +} -- cgit