From fde9b21a4062e4734eda8864775c1057f1b86b70 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 9 Jan 2020 11:32:14 +0100 Subject: [PATCH] Fix syntheticMethodForProperty.kt for JDK 9+ and Android tests --- .../box/annotations/syntheticMethodForProperty.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/compiler/testData/codegen/box/annotations/syntheticMethodForProperty.kt b/compiler/testData/codegen/box/annotations/syntheticMethodForProperty.kt index 269d1a46d59..2e0d7575aa7 100644 --- a/compiler/testData/codegen/box/annotations/syntheticMethodForProperty.kt +++ b/compiler/testData/codegen/box/annotations/syntheticMethodForProperty.kt @@ -4,6 +4,8 @@ // WITH_RUNTIME // FULL_JDK +package test + import java.lang.reflect.Modifier import kotlin.test.* @@ -30,7 +32,8 @@ fun check(clazz: Class<*>, expected: Boolean = true) { assertTrue(method.isSynthetic()) assertTrue(Modifier.isStatic(method.modifiers)) assertTrue(Modifier.isPublic(method.modifiers)) - assertEquals("[@Anno(value=OK)]", method.declaredAnnotations.toList().toString()) + val str = method.declaredAnnotations.single().toString() + assertTrue("@test.Anno\\(value=\"?OK\"?\\)".toRegex().matches(str), str) return } } @@ -40,9 +43,9 @@ fun check(clazz: Class<*>, expected: Boolean = true) { } fun box(): String { - check(Class.forName("A")) - check(Class.forName("SyntheticMethodForPropertyKt")) - check(Class.forName("T"), expected = false) - check(Class.forName("T\$DefaultImpls")) + check(Class.forName("test.A")) + check(Class.forName("test.SyntheticMethodForPropertyKt")) + check(Class.forName("test.T"), expected = false) + check(Class.forName("test.T\$DefaultImpls")) return "OK" }