Skip to content

Commit 4ebd80f

Browse files
committed
Fix the tests after updating to Kotlin 2.1.0
1 parent 0f12171 commit 4ebd80f

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

components/resources/library/src/commonTest/kotlin/org/jetbrains/compose/resources/ComposeResourceTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import androidx.compose.material3.Text
55
import androidx.compose.runtime.*
66
import androidx.compose.ui.test.ExperimentalTestApi
77
import androidx.compose.ui.test.runComposeUiTest
8+
import kotlinx.coroutines.Dispatchers
9+
import kotlinx.coroutines.delay
810
import kotlinx.coroutines.test.runTest
11+
import kotlinx.coroutines.withContext
912
import kotlin.test.*
1013

1114
@OptIn(ExperimentalTestApi::class, InternalResourceApi::class)

components/resources/library/src/commonTest/kotlin/org/jetbrains/compose/resources/RecompositionsCounter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package org.jetbrains.compose.resources
22

33
import androidx.compose.runtime.Composable
4+
import androidx.compose.runtime.NonSkippableComposable
45

56
internal class RecompositionsCounter {
67
var count = 0
78
private set
89

910
@Composable
11+
@NonSkippableComposable
1012
fun content(block: @Composable () -> Unit) {
1113
count++
1214
block()

components/resources/library/src/commonTest/kotlin/org/jetbrains/compose/resources/StringFormatTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class StringFormatTest {
8787
}
8888

8989
@Test
90-
fun `replaceWithArgs ensures %d and %s placeholders behave identically`() {
90+
fun `replaceWithArgs ensures _d and _s placeholders behave identically`() {
9191
val template = "%1\$d, %1\$s, %2\$d, %2\$s"
9292
val args = listOf("42", "hello")
9393

html/core/src/jsTest/kotlin/FailingTestCases.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.jetbrains.compose.web.core.tests
77

88
import kotlin.test.Test
9+
import kotlin.test.assertFalse
910
import kotlin.test.assertTrue
1011

1112
class FailingTestCases {
@@ -20,7 +21,8 @@ class FailingTestCases {
2021
} catch (e: Throwable) {
2122
expectedErrorThrown = true
2223
}
23-
assertTrue(expectedErrorThrown)
24+
// No exception in Kotlin 2.1.0
25+
assertFalse(expectedErrorThrown)
2426
}
2527
}
2628

0 commit comments

Comments
 (0)