Add whitespace tests issue #10
diff --git a/test/mustache_test.dart b/test/mustache_test.dart
index fc7aa0e..67f8c92 100644
--- a/test/mustache_test.dart
+++ b/test/mustache_test.dart
@@ -69,6 +69,24 @@
}});
expect(output, equals('.bob._jim__sally_.'));
});
+
+ test('Whitespace in section tags', () {
+ expect(parse('{{#foo.bar}}oi{{/foo.bar}}').renderString({'foo': {'bar': true}}), equals('oi'));
+ expect(parse('{{# foo.bar}}oi{{/foo.bar}}').renderString({'foo': {'bar': true}}), equals('oi'));
+ expect(parse('{{#foo.bar }}oi{{/foo.bar}}').renderString({'foo': {'bar': true}}), equals('oi'));
+ expect(parse('{{# foo.bar }}oi{{/foo.bar}}').renderString({'foo': {'bar': true}}), equals('oi'));
+ expect(parse('{{#foo.bar}}oi{{/ foo.bar}}').renderString({'foo': {'bar': true}}), equals('oi'));
+ expect(parse('{{#foo.bar}}oi{{/foo.bar }}').renderString({'foo': {'bar': true}}), equals('oi'));
+ expect(parse('{{#foo.bar}}oi{{/ foo.bar }}').renderString({'foo': {'bar': true}}), equals('oi'));
+ expect(parse('{{# foo.bar }}oi{{/ foo.bar }}').renderString({'foo': {'bar': true}}), equals('oi'));
+ });
+
+ test('Whitespace in variable tags', () {
+ expect(parse('{{foo.bar}}').renderString({'foo': {'bar': true}}), equals('true'));
+ expect(parse('{{ foo.bar}}').renderString({'foo': {'bar': true}}), equals('true'));
+ expect(parse('{{foo.bar }}').renderString({'foo': {'bar': true}}), equals('true'));
+ expect(parse('{{ foo.bar }}').renderString({'foo': {'bar': true}}), equals('true'));
+ });
});
group('Inverse Section', () {