fix for using {{.}} in non-standards mode

in non-standards mode (which is the default), {{.}} would be treated as a compound key, resulting in key not found exceptions.
This commit is contained in:
Sean Scanlon
2011-03-27 16:07:20 -07:00
parent 5fc751219e
commit 095c6f9a59
2 changed files with 5 additions and 1 deletions
@@ -169,11 +169,14 @@ public class MustacheTest
@Test public void testTopLevelThis () {
assertEquals("bar", Mustache.compiler().compile("{{this}}").execute("bar"));
assertEquals("bar", Mustache.compiler().compile("{{.}}").execute("bar"));
}
@Test public void testNestedThis () {
assertEquals("barbazbif", Mustache.compiler().compile("{{#things}}{{this}}{{/things}}").
execute(context("things", Arrays.asList("bar", "baz", "bif"))));
assertEquals("barbazbif", Mustache.compiler().compile("{{#things}}{{.}}{{/things}}").
execute(context("things", Arrays.asList("bar", "baz", "bif"))));
}
@Test public void testStructuredVariable () {