Skip to content

Commit

Permalink
refactor: migrate FlowJvmTest to Kotlin-test (#3228)
Browse files Browse the repository at this point in the history
  • Loading branch information
milgner authored Oct 29, 2023
1 parent 2fa4f41 commit 99b1bf0
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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 ->
Expand All @@ -25,8 +26,8 @@ class FlowJvmTest : StringSpec({
}
}
}
"parMap - flowOn" {

@Test fun parMapflowOn() = runTest {
resourceScope {
val ctx = singleThreadContext("single")
checkAll(Arb.flow(Arb.int())) { flow ->
Expand All @@ -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 ->
Expand All @@ -48,7 +49,7 @@ class FlowJvmTest : StringSpec({
}
}

"parMapUnordered - flowOn" {
@Test fun parMapUnorderedFlowOn() = runTest {
resourceScope {
val ctx = singleThreadContext("single")
checkAll(Arb.flow(Arb.int())) { flow ->
Expand All @@ -59,4 +60,4 @@ class FlowJvmTest : StringSpec({
}
}
}
})
}

0 comments on commit 99b1bf0

Please sign in to comment.