assertEquals(expecting, p.render());
}
@Test public void testEvalSTIteratingSubtemplateInSTFromAnotherGroup() throws Exception {
ErrorBuffer errors = new ErrorBuffer();
STGroup innerGroup = new STGroup();
innerGroup.setListener(errors);
innerGroup.defineTemplate("test", "m", "<m:samegroup()>");
innerGroup.defineTemplate("samegroup", "x", "hi ");
ST st = innerGroup.getInstanceOf("test");
st.add("m", new int[] {1,2,3});
STGroup outerGroup = new STGroup();
outerGroup.defineTemplate("errorMessage", "x", "<x>");
ST outerST = outerGroup.getInstanceOf("errorMessage");
outerST.add("x", st);
String expected = "hi hi hi ";
String result = outerST.render();