use of com.android.aapt.Resources.StyledString in project bundletool by google.
the class XmlProtoPrintUtilsTest method processStyledString_emptyString.
@Test
public void processStyledString_emptyString() {
StyledString styledString = StyledString.newBuilder().setValue("").build();
String processedString = XmlProtoPrintUtils.processStyledString(styledString);
assertThat(processedString).isEmpty();
}
use of com.android.aapt.Resources.StyledString in project bundletool by google.
the class XmlProtoPrintUtilsTest method processStyledString_multipleTagsAtSamePosition.
@Test
public void processStyledString_multipleTagsAtSamePosition() {
StyledString styledString = StyledString.newBuilder().setValue("hello").addSpan(Span.newBuilder().setTag("a").setFirstChar(0).setLastChar(4)).addSpan(Span.newBuilder().setTag("c").setFirstChar(0).setLastChar(4)).addSpan(Span.newBuilder().setTag("b").setFirstChar(0).setLastChar(4)).build();
String processedString = XmlProtoPrintUtils.processStyledString(styledString);
assertThat(processedString).isEqualTo("<a><b><c>hello</c></b></a>");
}
use of com.android.aapt.Resources.StyledString in project bundletool by google.
the class XmlProtoPrintUtilsTest method processStyledString_startAndEnd.
@Test
public void processStyledString_startAndEnd() {
StyledString styledString = StyledString.newBuilder().setValue("hello").addSpan(Span.newBuilder().setTag("a").setFirstChar(0).setLastChar(4)).build();
String processedString = XmlProtoPrintUtils.processStyledString(styledString);
assertThat(processedString).isEqualTo("<a>hello</a>");
}
use of com.android.aapt.Resources.StyledString in project bundletool by google.
the class XmlProtoPrintUtilsTest method processStyledString_withAttributeValueContainingEqualSign.
@Test
public void processStyledString_withAttributeValueContainingEqualSign() {
StyledString styledString = StyledString.newBuilder().setValue("hello").addSpan(Span.newBuilder().setTag("a;href=https://support.google.com?topic=123").setFirstChar(0).setLastChar(4)).build();
String processedString = XmlProtoPrintUtils.processStyledString(styledString);
assertThat(processedString).isEqualTo("<a href=\"https://support.google.com?topic=123\">hello</a>");
}
Aggregations