Skip to content

Commit 81baf9c

Browse files
authored
Preserve binary compatibility with TestScope.runTest(Long) (#3676)
Fixes #3673
1 parent 9f9cb87 commit 81baf9c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

kotlinx-coroutines-test/api/kotlinx-coroutines-test.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public final class kotlinx/coroutines/test/TestBuildersKt {
2222
public static final fun runTest (Lkotlinx/coroutines/test/TestScope;JLkotlin/jvm/functions/Function2;)V
2323
public static synthetic fun runTest$default (Lkotlin/coroutines/CoroutineContext;JLkotlin/jvm/functions/Function2;ILjava/lang/Object;)V
2424
public static synthetic fun runTest$default (Lkotlinx/coroutines/test/TestCoroutineScope;JLkotlin/jvm/functions/Function2;ILjava/lang/Object;)V
25+
public static final synthetic fun runTest$default (Lkotlinx/coroutines/test/TestScope;Ljava/lang/Long;Lkotlin/jvm/functions/Function2;Ljava/lang/Integer;Ljava/lang/Object;)V
2526
public static final fun runTest-8Mi8wO0 (Lkotlin/coroutines/CoroutineContext;JLkotlin/jvm/functions/Function2;)V
2627
public static final fun runTest-8Mi8wO0 (Lkotlinx/coroutines/test/TestScope;JLkotlin/jvm/functions/Function2;)V
2728
public static synthetic fun runTest-8Mi8wO0$default (Lkotlin/coroutines/CoroutineContext;JLkotlin/jvm/functions/Function2;ILjava/lang/Object;)V

kotlinx-coroutines-test/common/src/TestBuilders.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,3 +570,16 @@ internal fun throwAll(head: Throwable?, other: List<Throwable>) {
570570
}
571571

572572
internal expect fun dumpCoroutines()
573+
574+
@Deprecated(
575+
"This is for binary compatibility with the `runTest` overload that existed at some point",
576+
level = DeprecationLevel.HIDDEN
577+
)
578+
@JvmName("runTest\$default")
579+
@Suppress("DEPRECATION", "UNUSED_PARAMETER")
580+
public fun TestScope.runTestLegacy(
581+
dispatchTimeoutMs: Long?,
582+
testBody: suspend TestScope.() -> Unit,
583+
unused1: Int?,
584+
unused2: Any?,
585+
): TestResult = runTest(dispatchTimeoutMs ?: 60_000, testBody)

0 commit comments

Comments
 (0)