Ejemplo n.º 1
0
 @Test
 public void testDontTrimJustSpaceBeforeAfterInTemplate() throws Exception {
   String templates = "a(x) ::= << foo >>\n";
   STGroupString group = new STGroupString(templates);
   ST st = group.getInstanceOf("a");
   String expected = " foo ";
   String result = st.render();
   assertEquals(expected, result);
 }
Ejemplo n.º 2
0
 @Test
 public void testTrimmedNewlinesBeforeAfterInTemplate() throws Exception {
   String templates = "a(x) ::= <<" + newline + "foo" + newline + ">>" + newline;
   STGroupString group = new STGroupString(templates);
   ST st = group.getInstanceOf("a");
   String expected = "foo";
   String result = st.render();
   assertEquals(expected, result);
 }