Skip to content

Commit

Permalink
Update runTest signature to match runBlocking (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored Nov 4, 2020
1 parent 00d23e6 commit f0955aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/src/commonMain/kotlin/runTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import kotlinx.coroutines.CoroutineScope
// Adapted from:
// https://github.com/Kotlin/kotlinx.coroutines/issues/885#issuecomment-446586161
public expect fun runTest(
action: suspend (scope: CoroutineScope) -> Unit
action: suspend CoroutineScope.() -> Unit
)
4 changes: 2 additions & 2 deletions test/src/jsMain/kotlin/runTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.promise

public actual fun runTest(
action: suspend (scope: CoroutineScope) -> Unit
): dynamic = GlobalScope.promise { action(this) }
action: suspend CoroutineScope.() -> Unit
): dynamic = GlobalScope.promise { action.invoke(this) }
4 changes: 2 additions & 2 deletions test/src/jvmMain/kotlin/runTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.runBlocking

public actual fun runTest(
action: suspend (scope: CoroutineScope) -> Unit
): Unit = runBlocking { action(this) }
action: suspend CoroutineScope.() -> Unit
): Unit = runBlocking { action.invoke(this) }

0 comments on commit f0955aa

Please sign in to comment.