Attempt to resolve compound keys "whole" first.

This allows one to have a map with keys like "foo.bar.baz" even when not in
standards mode. If a whole key is missing, then we attempt to decompose it and
look it up piecewise.

Closes #55.
This commit is contained in:
Michael Bayne
2014-05-08 09:49:33 -07:00
parent 2f267b7199
commit f838c91f99
2 changed files with 50 additions and 34 deletions
@@ -421,6 +421,13 @@ public class MustacheTest
});
}
@Test public void testCompoundVariableAsPlain () {
// if a compound variable is found without decomposition, we use that first
test("wholekey", "{{foo.bar}}", context(
"foo.bar", "wholekey",
"foo", new Object() { String bar = "hello"; }));
}
@Test public void testNewlineSkipping () {
String tmpl = "list:\n" +
"{{#items}}\n" +