本文整理匯總了Java中com.google.template.soy.data.restricted.StringData.EMPTY_STRING屬性的典型用法代碼示例。如果您正苦於以下問題:Java StringData.EMPTY_STRING屬性的具體用法?Java StringData.EMPTY_STRING怎麽用?Java StringData.EMPTY_STRING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.template.soy.data.restricted.StringData
的用法示例。
在下文中一共展示了StringData.EMPTY_STRING屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testComputeForJava
@Test
public void testComputeForJava() {
BidiTextDirFunction bidiTextDirFunction = new BidiTextDirFunction();
SoyValue text = StringData.EMPTY_STRING;
assertThat(bidiTextDirFunction.computeForJava(ImmutableList.of(text)))
.isEqualTo(IntegerData.ZERO);
text = StringData.forValue("a");
assertThat(bidiTextDirFunction.computeForJava(ImmutableList.of(text)))
.isEqualTo(IntegerData.ONE);
text = StringData.forValue("\u05E0");
assertThat(bidiTextDirFunction.computeForJava(ImmutableList.of(text)))
.isEqualTo(IntegerData.MINUS_ONE);
text = SanitizedContents.unsanitizedText("a");
assertThat(bidiTextDirFunction.computeForJava(ImmutableList.of(text)))
.isEqualTo(IntegerData.ONE);
text = SanitizedContents.unsanitizedText("a", Dir.LTR);
assertThat(bidiTextDirFunction.computeForJava(ImmutableList.of(text)))
.isEqualTo(IntegerData.ONE);
text = SanitizedContents.unsanitizedText("a", Dir.RTL);
assertThat(bidiTextDirFunction.computeForJava(ImmutableList.of(text)))
.isEqualTo(IntegerData.MINUS_ONE);
text = SanitizedContents.unsanitizedText("a", Dir.NEUTRAL);
assertThat(bidiTextDirFunction.computeForJava(ImmutableList.of(text)))
.isEqualTo(IntegerData.ZERO);
}
示例2: testComputeForJava
@Test
public void testComputeForJava() {
SoyValue text = StringData.EMPTY_STRING;
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
text = StringData.forValue("a");
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
text = StringData.forValue("\u05E0");
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"dir=\"rtl\"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("\u05E0");
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"dir=\"rtl\"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("\u05E0", Dir.RTL);
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"dir=\"rtl\"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("\u05E0", Dir.LTR);
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("\u05E0", Dir.NEUTRAL);
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
text = StringData.EMPTY_STRING;
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
text = StringData.forValue("\u05E0");
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
text = StringData.forValue("a");
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"dir=\"ltr\"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("a");
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"dir=\"ltr\"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("a", Dir.LTR);
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"dir=\"ltr\"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("a", Dir.RTL);
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
text = SanitizedContents.unsanitizedText("a", Dir.NEUTRAL);
assertThat(BIDI_DIR_ATTR_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(
UnsafeSanitizedContentOrdainer.ordainAsSafe(
"", SanitizedContent.ContentKind.ATTRIBUTES));
}
示例3: testComputeForJava
@Test
public void testComputeForJava() {
SoyValue text = StringData.EMPTY_STRING;
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = StringData.forValue("a");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = StringData.forValue("\u05E0");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200E"));
text = SanitizedContents.unsanitizedText("a");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = SanitizedContents.unsanitizedText("a", Dir.LTR);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = SanitizedContents.unsanitizedText("a", Dir.NEUTRAL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = SanitizedContents.unsanitizedText("a", Dir.RTL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200E"));
text = SanitizedContents.unsanitizedText("\u05E0");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200E"));
text = SanitizedContents.unsanitizedText("\u05E0", Dir.RTL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200E"));
text = SanitizedContents.unsanitizedText("\u05E0", Dir.NEUTRAL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200E"));
text = SanitizedContents.unsanitizedText("\u05E0", Dir.LTR);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_LTR.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200E"));
text = StringData.EMPTY_STRING;
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = StringData.forValue("\u05E0");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = StringData.forValue("a");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200F"));
text = SanitizedContents.unsanitizedText("\u05E0");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = SanitizedContents.unsanitizedText("\u05E0", Dir.RTL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = SanitizedContents.unsanitizedText("\u05E0", Dir.NEUTRAL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.EMPTY_STRING);
text = SanitizedContents.unsanitizedText("\u05E0", Dir.LTR);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200F"));
text = SanitizedContents.unsanitizedText("a");
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200F"));
text = SanitizedContents.unsanitizedText("a", Dir.LTR);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200F"));
text = SanitizedContents.unsanitizedText("a", Dir.NEUTRAL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200F"));
text = SanitizedContents.unsanitizedText("a", Dir.RTL);
assertThat(BIDI_MARK_AFTER_FUNCTION_FOR_STATIC_RTL.computeForJava(ImmutableList.of(text)))
.isEqualTo(StringData.forValue("\u200F"));
}