diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParZip5Test.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParZip5Test.kt index be3b3373e33..cc15ced6673 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParZip5Test.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParZip5Test.kt @@ -8,7 +8,6 @@ import arrow.fx.coroutines.awaitExitCase import arrow.fx.coroutines.leftException import arrow.fx.coroutines.parZip import arrow.fx.coroutines.throwable -import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.should import io.kotest.matchers.shouldBe import io.kotest.matchers.types.shouldBeTypeOf @@ -22,9 +21,12 @@ import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.async import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.test.runTest +import kotlin.test.Test -class ParZip5Test : StringSpec({ - "parZip 5 runs in parallel" { +class ParZip5Test { + @Test + fun parZip5RunsInParallel() = runTest { checkAll(Arb.int(), Arb.int(), Arb.int(), Arb.int(), Arb.int()) { a, b, c, d, e -> val r = Atomic("") val modifyGate1 = CompletableDeferred() @@ -63,8 +65,9 @@ class ParZip5Test : StringSpec({ r.get() shouldBe "$e$d$c$b$a" } } - - "Cancelling parZip 5 cancels all participants" { + + @Test + fun CancellingParZip5CancelsAllParticipants() = runTest { val s = Channel() val pa = CompletableDeferred() val pb = CompletableDeferred() @@ -99,8 +102,9 @@ class ParZip5Test : StringSpec({ pd.await().shouldBeTypeOf() pe.await().shouldBeTypeOf() } - - "parZip 5 cancels losers if a failure occurs in one of the tasks" { + + @Test + fun parZip5CancelsLosersIfAFailureOccursInOneOfTheTasks() = runTest { checkAll( Arb.throwable(), Arb.element(listOf(1, 2, 3, 4, 5)), @@ -134,8 +138,9 @@ class ParZip5Test : StringSpec({ r should leftException(e) } } - - "parZip CancellationException on right can cancel rest" { + + @Test + fun parZipCancellationExceptionOnRightCanCancelRest() = runTest { checkAll(Arb.string(), Arb.int(1..5)) { msg, cancel -> val s = Channel() val pa = CompletableDeferred() @@ -167,4 +172,3 @@ class ParZip5Test : StringSpec({ } } } -)