diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip5JvmTest.kt b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip5JvmTest.kt index 34596e56a88..98ede0dcf03 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip5JvmTest.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip5JvmTest.kt @@ -3,7 +3,6 @@ package arrow.fx.coroutines import arrow.core.Either import arrow.core.Tuple5 import io.kotest.assertions.assertSoftly -import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.should import io.kotest.matchers.string.shouldStartWith import io.kotest.mpp.NamedThreadFactory @@ -14,13 +13,15 @@ import io.kotest.property.checkAll import java.util.concurrent.Executors import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.awaitCancellation +import kotlinx.coroutines.test.runTest import kotlinx.coroutines.withContext +import kotlin.test.Test -class ParZip5JvmTest : StringSpec({ +class ParZip5JvmTest { val threadName: suspend CoroutineScope.() -> String = { Thread.currentThread().name } - "parZip 5 returns to original context" { + @Test fun parZip5ReturnsToOriginalContext() = runTest { val zipCtxName = "parZip5" resourceScope { val zipCtx = executor { Executors.newFixedThreadPool(5, NamedThreadFactory(zipCtxName)) } @@ -40,10 +41,9 @@ class ParZip5JvmTest : StringSpec({ threadName() shouldStartWith "single" } } - } - "parZip 5 returns to original context on failure" { + @Test fun parZip5ReturnsToOriginalContextOnFailure() = runTest { val zipCtxName = "parZip5" resourceScope { val zipCtx = executor { Executors.newFixedThreadPool(5, NamedThreadFactory(zipCtxName)) } @@ -107,7 +107,7 @@ class ParZip5JvmTest : StringSpec({ } } - "parZip 5 finishes on single thread" { + @Test fun parZip5FinishesOnSingleThread() = runTest { checkAll(Arb.string()) { val res = resourceScope { val ctx = singleThreadContext("single") @@ -127,4 +127,3 @@ class ParZip5JvmTest : StringSpec({ } } } -)