KT-53327 replace Enum.values() with Enum.entries in CharCategory

Also, replace it in stdlib tests where appropriate and disable already unsupported legacy JS tests


^KT-53327 fixed

Co-authored-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>

Merge-request: KT-MR-10632
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
This commit is contained in:
Vsevolod Tolstopyatov
2023-06-21 14:40:16 +00:00
committed by Space Team
parent c867a4b52f
commit 175cf5e833
13 changed files with 30 additions and 30 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@@ -10,6 +10,7 @@ import kotlin.test.*
import test.collections.behaviors.listBehavior
import test.collections.compare
@Suppress("EnumValuesSoftDeprecate") // <- Used deliberately as a sanity check for tests
class EnumEntriesListTest {
enum class EmptyEnum
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -14,10 +14,10 @@ class KTypeProjectionTest {
@Test
fun constructorArgumentsValidation() {
assertFailsWith<IllegalArgumentException> { KTypeProjection(null, typeOf<Int>()) }
for (variance in KVariance.values()) {
for (variance in KVariance.entries) {
assertFailsWith<IllegalArgumentException> { KTypeProjection(variance, null) }.let { e ->
assertTrue(variance.toString() in e.message!!)
}
}
}
}
}
+1 -1
View File
@@ -20,7 +20,7 @@ import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.nanoseconds
import kotlin.time.Duration.Companion.seconds
private val units = DurationUnit.values()
private val units = DurationUnit.entries
class DurationTest {
+1 -1
View File
@@ -14,7 +14,7 @@ import kotlin.time.Duration.Companion.nanoseconds
import kotlin.time.Duration.Companion.seconds
class TimeMarkTest {
private val units = DurationUnit.values()
private val units = DurationUnit.entries
private fun TimeMark.assertHasPassed(hasPassed: Boolean) {
assertEquals(!hasPassed, this.hasNotPassedNow(), "Expected mark in the future")