use of com.google.template.soy.pysrc.restricted.PyExpr in project closure-templates by google.
the class GenPyExprsVisitorTest method testCss.
@Test
public void testCss() {
assertThatSoyExpr("{css('primary')}").compilesTo(new PyExpr("runtime.get_css_name('primary')", Integer.MAX_VALUE));
assertThatSoyExpr("{@param foo:?}\n{css($foo, 'bar')}").compilesTo(new PyExpr("runtime.get_css_name(data.get('foo'), 'bar')", Integer.MAX_VALUE));
}
use of com.google.template.soy.pysrc.restricted.PyExpr in project closure-templates by google.
the class GenPyExprsVisitorTest method testSimpleMsgFallbackGroupNodeWithOneNode.
@Test
public void testSimpleMsgFallbackGroupNodeWithOneNode() {
String soyCode = "{msg meaning=\"verb\" desc=\"Used as a verb.\"}\n" + " Archive\n" + "{/msg}\n";
String expectedPyCode = "translator_impl.render_literal(" + "translator_impl.prepare_literal(" + "###, " + "'Archive'))";
assertThatSoyExpr(soyCode).compilesTo(new PyExpr(expectedPyCode, Integer.MAX_VALUE));
}
Aggregations