" {/foreach}\n";
List<StandaloneNode> nodes = parseTemplateBody(templateBody);
assertEquals(2, nodes.size());
ForeachNode fn0 = (ForeachNode) nodes.get(0);
assertEquals("goo", fn0.getVarName());
assertEquals("$goose", fn0.getExprText());
assertEquals(0, ((DataRefNode) fn0.getExpr().getChild(0)).numChildren());
assertEquals(1, fn0.numChildren());
ForeachNonemptyNode fn0fnn0 = (ForeachNonemptyNode) fn0.getChild(0);
assertEquals(2, fn0fnn0.numChildren());
assertEquals("$goose.numKids", ((PrintNode) fn0fnn0.getChild(0)).getExprText());
assertEquals(" goslings.\n", ((RawTextNode) fn0fnn0.getChild(1)).getRawText());
ForeachNode fn1 = (ForeachNode) nodes.get(1);
assertEquals("boo", fn1.getVarName());
assertEquals("$foo.booze", fn1.getExprText());
assertEquals(1, ((DataRefNode) fn1.getExpr().getChild(0)).numChildren());
assertEquals(2, fn1.numChildren());
ForeachNonemptyNode fn1fnn0 = (ForeachNonemptyNode) fn1.getChild(0);
assertEquals("boo", fn1fnn0.getVarName());
assertEquals("$foo.booze", fn1fnn0.getExprText());
assertEquals("boo", fn1fnn0.getVarName());
assertEquals(4, fn1fnn0.numChildren());
IfNode fn1fnn0in = (IfNode) fn1fnn0.getChild(3);
assertEquals(1, fn1fnn0in.numChildren());
assertEquals("not isLast($boo)", ((IfCondNode) fn1fnn0in.getChild(0)).getExprText());
ForeachIfemptyNode fn1fin1 = (ForeachIfemptyNode) fn1.getChild(1);
assertEquals(1, fn1fin1.numChildren());
assertEquals("Sorry, no booze.", ((RawTextNode) fn1fin1.getChild(0)).getRawText());
}