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:
@@ -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" +
|
||||
|
||||
Reference in New Issue
Block a user