}
public void testComputeForJsSrc() {
JsExpr textExpr = new JsExpr("TEXT_JS_CODE", Integer.MAX_VALUE);
assertEquals(new JsExpr("soy.$$bidiDirAttr(1, TEXT_JS_CODE)", Integer.MAX_VALUE),
BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJsSrc(ImmutableList.of(textExpr)));
assertEquals(new JsExpr("soy.$$bidiDirAttr(IS_RTL?-1:1, TEXT_JS_CODE)", Integer.MAX_VALUE),
BIDI_DIR_ATTR_FUNCTION_FOR_ISRTL_CODE_SNIPPET.computeForJsSrc(
ImmutableList.of(textExpr)));
JsExpr isHtmlExpr = new JsExpr("IS_HTML_JS_CODE", Integer.MAX_VALUE);
assertEquals(new JsExpr("soy.$$bidiDirAttr(-1, TEXT_JS_CODE, IS_HTML_JS_CODE)",
Integer.MAX_VALUE),
BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJsSrc(
ImmutableList.of(textExpr, isHtmlExpr)));
assertEquals(new JsExpr("soy.$$bidiDirAttr(IS_RTL?-1:1, TEXT_JS_CODE, IS_HTML_JS_CODE)",
Integer.MAX_VALUE),
BIDI_DIR_ATTR_FUNCTION_FOR_ISRTL_CODE_SNIPPET.computeForJsSrc(
ImmutableList.of(textExpr, isHtmlExpr)));
}