[K/N] Fix K2 detection in native tests

This updates how the requested language version is detected in native
tests, after language version 2 has become the default.
This commit is contained in:
Troels Bjerre Lund
2023-10-24 10:55:26 +02:00
committed by Space Cloud
parent 56f53fbd0b
commit 3556533d95
@@ -53,12 +53,9 @@ object PlatformInfo {
@JvmStatic @JvmStatic
fun isK2(project: Project): Boolean { fun isK2(project: Project): Boolean {
return project.globalTestArgs.contains("-language-version") && val idx = project.globalTestArgs.indexOf("-language-version")
// Enough future versions are specified until K1 will be stopped to test if (idx == -1) return true
(project.globalTestArgs.contains("2.0") return project.globalTestArgs[idx + 1].toDouble() >= 2.0
|| project.globalTestArgs.contains("2.1")
|| project.globalTestArgs.contains("2.2")
)
} }
@JvmStatic @JvmStatic