Add option to treat empty string as falsy value

This commit is contained in:
Mickael Jeanroy
2012-08-13 20:57:29 +02:00
parent a7f0e92d92
commit af91e58024
2 changed files with 33 additions and 10 deletions
@@ -138,6 +138,12 @@ public class MustacheTest
});
}
@Test public void testSectionWithEmptyString () {
test(Mustache.compiler().emptyStringIsFalse(true), "", "{{#foo}}test{{/foo}}", new Object() {
String foo = "";
});
}
@Test public void testMissingSection () {
test("", "{{#foo}}{{bar}}{{/foo}}", new Object() {
// no foo