Test parsing keepattribute with a class name.
Bug: 130746806
Change-Id: Ia7a1c1054997ca1680587b556dcd4fbbde9a74b9
diff --git a/src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java b/src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
index d0fb723..ea5c72d 100644
--- a/src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
+++ b/src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
@@ -1350,7 +1350,7 @@
}
@Test
- public void parseInvalidKeepattributes() {
+ public void parseInvalidKeepattributes_brokenList() {
try {
ProguardConfigurationParser parser =
new ProguardConfigurationParser(new DexItemFactory(), reporter);
@@ -1363,6 +1363,21 @@
}
@Test
+ public void parseInvalidKeepattributes_className() {
+ try {
+ ProguardConfigurationParser parser =
+ new ProguardConfigurationParser(new DexItemFactory(), reporter);
+ parser.parse(createConfigurationForTesting(
+ ImmutableList.of("-keepattributes androidx.annotation.Keep")));
+ fail();
+ } catch (AbortException e) {
+ // TODO(b/130746806): better error message?
+ assertTrue(
+ handler.errors.get(0).getDiagnosticMessage().contains("Expected char '-' at "));
+ }
+ }
+
+ @Test
public void parseUseUniqueClassMemberNames() throws IOException {
Path proguardConfig = writeTextToTempFile("-useuniqueclassmembernames");
new ProguardConfigurationParser(new DexItemFactory(), reporter).parse(proguardConfig);