From 99b1bf0cd6b756419b781c15c05b86d764c1e2ce Mon Sep 17 00:00:00 2001 From: Marcus Ilgner Date: Sun, 29 Oct 2023 07:42:03 +0100 Subject: [PATCH] refactor: migrate FlowJvmTest to Kotlin-test (#3228) --- .../kotlin/arrow/fx/coroutines/FlowJvmTest.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/FlowJvmTest.kt b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/FlowJvmTest.kt index c4c05febe8a..1ca0f21b4d9 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/FlowJvmTest.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/FlowJvmTest.kt @@ -1,22 +1,23 @@ package arrow.fx.coroutines -import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain import io.kotest.property.Arb import io.kotest.property.arbitrary.int import io.kotest.property.checkAll +import kotlin.test.Test import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.toList import kotlinx.coroutines.flow.toSet import kotlin.time.ExperimentalTime import kotlinx.coroutines.flow.flowOn +import kotlinx.coroutines.test.runTest @OptIn(FlowPreview::class, ExperimentalCoroutinesApi::class) @ExperimentalTime -class FlowJvmTest : StringSpec({ - "parMap - single thread - identity" { +class FlowJvmTest { + @Test fun parMapSingleThreadIdentity() = runTest { resourceScope { val ctx = singleThreadContext("single") checkAll(Arb.flow(Arb.int())) { flow -> @@ -25,8 +26,8 @@ class FlowJvmTest : StringSpec({ } } } - - "parMap - flowOn" { + + @Test fun parMapflowOn() = runTest { resourceScope { val ctx = singleThreadContext("single") checkAll(Arb.flow(Arb.int())) { flow -> @@ -38,7 +39,7 @@ class FlowJvmTest : StringSpec({ } } - "parMapUnordered - single thread - identity" { + @Test fun parMapUnorderedSingleThreadIdentity() = runTest { resourceScope { val ctx = singleThreadContext("single") checkAll(Arb.flow(Arb.int())) { flow -> @@ -48,7 +49,7 @@ class FlowJvmTest : StringSpec({ } } - "parMapUnordered - flowOn" { + @Test fun parMapUnorderedFlowOn() = runTest { resourceScope { val ctx = singleThreadContext("single") checkAll(Arb.flow(Arb.int())) { flow -> @@ -59,4 +60,4 @@ class FlowJvmTest : StringSpec({ } } } -}) +}