Search in sources :

Example 1 with Style

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

the class ResourceTableMergerTest method stripSourceReferences_inRepeatedField_strips.

@Test
public void stripSourceReferences_inRepeatedField_strips() throws Exception {
    Style withoutSource = Style.newBuilder().setParent(Reference.newBuilder().setName("dad")).addEntry(Style.Entry.newBuilder().setComment("comment")).build();
    Style.Builder withSourceBuilder = withoutSource.toBuilder();
    withSourceBuilder.getEntryBuilder(0).setSource(Source.newBuilder().setPathIdx(42));
    Style withSource = withSourceBuilder.build();
    assertThat(withSource).isNotEqualTo(withoutSource);
    Style.Builder stripped = withSource.toBuilder();
    ResourceTableMerger.stripSourceReferences(stripped);
    assertThat(stripped.build()).isEqualTo(withoutSource);
}
Also used : Style(com.android.aapt.Resources.Style) Test(org.junit.Test)

Example 2 with Style

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

the class ResourceTableMergerTest method stripSourceReferences_inTopLevelField_strips.

@Test
public void stripSourceReferences_inTopLevelField_strips() throws Exception {
    Style withoutSource = Style.newBuilder().setParent(Reference.newBuilder().setName("dad")).build();
    Style withSource = withoutSource.toBuilder().setParentSource(Source.newBuilder().setPathIdx(42)).build();
    assertThat(withSource).isNotEqualTo(withoutSource);
    Style.Builder stripped = withSource.toBuilder();
    ResourceTableMerger.stripSourceReferences(stripped);
    assertThat(stripped.build()).isEqualTo(withoutSource);
}
Also used : Style(com.android.aapt.Resources.Style) Test(org.junit.Test)

Aggregations

Style (com.android.aapt.Resources.Style)2 Test (org.junit.Test)2