Add option to treat empty string as falsy value
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user