Search in sources :

Example 6 with CompoundValue

use of com.android.aapt.Resources.CompoundValue in project bundletool by google.

the class XmlProtoPrintUtilsTest method getCompoundValueAsString_attr.

@Test
public void getCompoundValueAsString_attr() {
    CompoundValue compoundValue = CompoundValue.newBuilder().setAttr(Attribute.newBuilder().addSymbol(Symbol.newBuilder().setName(createReference("name1")).setValue(123)).addSymbol(Symbol.newBuilder().setName(createReference("name2")).setValue(456))).build();
    assertThat(XmlProtoPrintUtils.getCompoundValueAsString(compoundValue)).isEqualTo("{name1=123, name2=456}");
}
Also used : CompoundValue(com.android.aapt.Resources.CompoundValue) Test(org.junit.Test)

Example 7 with CompoundValue

use of com.android.aapt.Resources.CompoundValue in project bundletool by google.

the class XmlProtoPrintUtilsTest method getCompoundValueAsString_plural.

@Test
public void getCompoundValueAsString_plural() {
    CompoundValue compoundValue = CompoundValue.newBuilder().setPlural(Plural.newBuilder().addEntry(Plural.Entry.newBuilder().setArity(Arity.ONE).setItem(createItem("one"))).addEntry(Plural.Entry.newBuilder().setArity(Arity.MANY).setItem(createItem("many")))).build();
    assertThat(XmlProtoPrintUtils.getCompoundValueAsString(compoundValue)).isEqualTo("{ONE=\"one\", MANY=\"many\"}");
}
Also used : CompoundValue(com.android.aapt.Resources.CompoundValue) Test(org.junit.Test)

Aggregations

CompoundValue (com.android.aapt.Resources.CompoundValue)7 Test (org.junit.Test)6 ConfigValue (com.android.aapt.Resources.ConfigValue)1 Item (com.android.aapt.Resources.Item)1 ResourceId (com.android.tools.build.bundletool.model.ResourceId)1 ResourceTableEntry (com.android.tools.build.bundletool.model.ResourceTableEntry)1 ArrayDeque (java.util.ArrayDeque)1 HashSet (java.util.HashSet)1