use of com.google.template.soy.soytree.LogNode in project closure-templates by google.
the class TemplateParserTest method testParseLogStmt.
@Test
public void testParseLogStmt() throws Exception {
String templateBody = "{@param foo : ?}\n" + "{log}Blah {$foo}.{/log}";
List<StandaloneNode> nodes = parseTemplateContent(templateBody, FAIL).getChildren();
assertEquals(1, nodes.size());
LogNode logNode = (LogNode) nodes.get(0);
assertEquals(3, logNode.numChildren());
assertEquals("Blah ", ((RawTextNode) logNode.getChild(0)).getRawText());
assertEquals("$foo", ((PrintNode) logNode.getChild(1)).getExpr().toSourceString());
}
Aggregations