Skip to content

Commit

Permalink
Fix the tests after updating to Kotlin 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eymar committed Jan 21, 2025
1 parent 0f12171 commit 4ebd80f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.runComposeUiTest
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.withContext
import kotlin.test.*

@OptIn(ExperimentalTestApi::class, InternalResourceApi::class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.jetbrains.compose.resources

import androidx.compose.runtime.Composable
import androidx.compose.runtime.NonSkippableComposable

internal class RecompositionsCounter {
var count = 0
private set

@Composable
@NonSkippableComposable
fun content(block: @Composable () -> Unit) {
count++
block()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class StringFormatTest {
}

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

Expand Down
4 changes: 3 additions & 1 deletion html/core/src/jsTest/kotlin/FailingTestCases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package org.jetbrains.compose.web.core.tests

import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue

class FailingTestCases {
Expand All @@ -20,7 +21,8 @@ class FailingTestCases {
} catch (e: Throwable) {
expectedErrorThrown = true
}
assertTrue(expectedErrorThrown)
// No exception in Kotlin 2.1.0
assertFalse(expectedErrorThrown)
}
}

Expand Down

0 comments on commit 4ebd80f

Please sign in to comment.