Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: migrate FlowJvmTest to Kotlin-test #3228

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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({
}
}
}
})
}