From 74a92229c7853c2c2a9603aae29d090c82f535c2 Mon Sep 17 00:00:00 2001 From: Chris Black <2538545+chrsblck@users.noreply.github.com> Date: Thu, 2 Nov 2023 02:46:22 -0700 Subject: [PATCH] Refactor ParZip7JvmTest from Kotest Plugin to Kotlin-test runtime (#3247) Closes #3209 Co-authored-by: Alejandro Serrano --- .../kotlin/arrow/fx/coroutines/ParZip7JvmTest.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip7JvmTest.kt b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip7JvmTest.kt index 502519e47e4..1af73d38194 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip7JvmTest.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/ParZip7JvmTest.kt @@ -3,7 +3,6 @@ package arrow.fx.coroutines import arrow.core.Either import arrow.core.Tuple7 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 ParZip7JvmTest : StringSpec({ +class ParZip7JvmTest { val threadName: suspend CoroutineScope.() -> String = { Thread.currentThread().name } - "parZip 7 returns to original context" { + @Test fun parZip7ReturnsToOriginalContext() = runTest { val zipCtxName = "parZip7" resourceScope { val zipCtx = executor { Executors.newFixedThreadPool(7, NamedThreadFactory(zipCtxName)) } @@ -46,7 +47,7 @@ class ParZip7JvmTest : StringSpec({ } } - "parZip 7 returns to original context on failure" { + @Test fun parZip7ReturnsToOriginalContextOnFailure() = runTest { val zipCtxName = "parZip7" resourceScope { val zipCtx = executor { Executors.newFixedThreadPool(7, NamedThreadFactory(zipCtxName)) } @@ -141,7 +142,7 @@ class ParZip7JvmTest : StringSpec({ } } - "parZip 7 finishes on single thread" { + @Test fun parZip7FinishesOnSingleThread() = runTest { checkAll(Arb.string()) { val res = resourceScope { val ctx = singleThreadContext("single") @@ -164,4 +165,3 @@ class ParZip7JvmTest : StringSpec({ } } } -)