Closed kkress2000 closed 6 years ago
This is working for me, @kkress2000:
@Test public void testImportUtfTemplateFileSameDir() throws Exception {
/*
dir
group.stg (that imports c.st)
c.st
*/
String dir = getRandomDir();
String groupFile =
"import \"c.st\"\n" +
"a() ::= \"g1 a\"\n"+
"b() ::= \"<c()>\"\n";
writeFile(dir, "group.stg", groupFile);
writeFile(dir, "c.st", "c() ::= \"2∏r\"\n");
STGroup group1 = new STGroupFile(dir+"/group.stg");
ST st = group1.getInstanceOf("c"); // should see c()
String expected = "2∏r";
String result = st.render();
assertEquals(expected, result);
}
Test: