Use JDK 21 in AdditionalBuiltInsMembersSignatureListsTest
^KT-58765
This commit is contained in:
committed by
Space Team
parent
4ef830f9ee
commit
8c2293ddcd
+13
-16
@@ -32,7 +32,7 @@ import org.jetbrains.kotlin.test.TestJdkKind
|
|||||||
|
|
||||||
class AdditionalBuiltInsMembersSignatureListsTest : KotlinTestWithEnvironment() {
|
class AdditionalBuiltInsMembersSignatureListsTest : KotlinTestWithEnvironment() {
|
||||||
override fun createEnvironment(): KotlinCoreEnvironment {
|
override fun createEnvironment(): KotlinCoreEnvironment {
|
||||||
return createEnvironmentWithJdk(ConfigurationKind.JDK_ONLY, TestJdkKind.FULL_JDK_17)
|
return createEnvironmentWithJdk(ConfigurationKind.JDK_ONLY, TestJdkKind.FULL_JDK_21)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testAllListedSignaturesExistInJdk() {
|
fun testAllListedSignaturesExistInJdk() {
|
||||||
@@ -56,10 +56,10 @@ class AdditionalBuiltInsMembersSignatureListsTest : KotlinTestWithEnvironment()
|
|||||||
|
|
||||||
val scope = classDescriptor.unsubstitutedMemberScope
|
val scope = classDescriptor.unsubstitutedMemberScope
|
||||||
|
|
||||||
val lateJdkSignatures = LATE_JDK_SIGNATURES[internalName] ?: emptySet()
|
val signaturesFromLaterJdkReleases = SIGNATURES_FROM_LATER_JDK_RELEASES[internalName] ?: emptySet()
|
||||||
|
|
||||||
for (jvmDescriptor in jvmDescriptors) {
|
for (jvmDescriptor in jvmDescriptors) {
|
||||||
if (jvmDescriptor in lateJdkSignatures) continue
|
if (jvmDescriptor in signaturesFromLaterJdkReleases) continue
|
||||||
|
|
||||||
val stringName = jvmDescriptor.split("(")[0]
|
val stringName = jvmDescriptor.split("(")[0]
|
||||||
val functions =
|
val functions =
|
||||||
@@ -75,17 +75,14 @@ class AdditionalBuiltInsMembersSignatureListsTest : KotlinTestWithEnvironment()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Get rid of it once JDK 21 is released (KT-58765 for tracking)
|
/**
|
||||||
private val LATE_JDK_SIGNATURES = mapOf(
|
* This property can be used to exclude particular signatures
|
||||||
"java/util/List" to setOf(
|
* from the [testAllListedSignaturesExistInJdk] test
|
||||||
// From JDK 21
|
* if they were introduced in later JDK releases than the test is currently configured to use.
|
||||||
"addFirst(Ljava/lang/Object;)V",
|
* It might be helpful in case the test can't be updated to these later JDK releases just yet
|
||||||
"addLast(Ljava/lang/Object;)V",
|
* (for example, if the JDK releases in question are not released as stable yet).
|
||||||
"getFirst()Ljava/lang/Object;",
|
*
|
||||||
"getLast()Ljava/lang/Object;",
|
* initialization example: `mapOf("java/util/List" to setOf("addFirst(Ljava/lang/Object;)V"))`
|
||||||
"removeFirst()Ljava/lang/Object;",
|
*/
|
||||||
"removeLast()Ljava/lang/Object;",
|
private val SIGNATURES_FROM_LATER_JDK_RELEASES: Map<String, Set<String>> = emptyMap()
|
||||||
"reversed()Ljava/util/List;",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user