Skip to content

Commit

Permalink
Refactor ParZip4JvmTest from Kotest Plugin to Kotlin-test runtime (#3257
Browse files Browse the repository at this point in the history
)

Closes #3206
  • Loading branch information
chrsblck authored Nov 2, 2023
1 parent 092838f commit b8595b0
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package arrow.fx.coroutines
import arrow.core.Either
import arrow.core.Tuple4
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
Expand All @@ -13,10 +12,12 @@ import io.kotest.property.arbitrary.string
import io.kotest.property.checkAll
import java.util.concurrent.Executors
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.withContext
import kotlin.test.Test

class ParZip4JvmTest : StringSpec({
"parZip 4 returns to original context" {
class ParZip4JvmTest {
@Test fun parZip4ReturnsToOriginalContext() = runTest {
val zipCtxName = "parZip4"
resourceScope {
val zipCtx = executor { Executors.newFixedThreadPool(4, NamedThreadFactory(zipCtxName)) }
Expand All @@ -41,7 +42,7 @@ class ParZip4JvmTest : StringSpec({
}
}

"parZip 4 returns to original context on failure" {
@Test fun parZip4ReturnsToOriginalContextOnFailure() = runTest {
val zipCtxName = "parZip4"
resourceScope {
val zipCtx = executor { Executors.newFixedThreadPool(4, NamedThreadFactory(zipCtxName)) }
Expand Down Expand Up @@ -92,7 +93,7 @@ class ParZip4JvmTest : StringSpec({
}
}

"parZip 4 finishes on single thread" {
@Test fun parZip4FinishesOnSingleThread() = runTest {
checkAll(Arb.string()) {
val res = resourceScope {
val ctx = singleThreadContext("single")
Expand All @@ -109,4 +110,3 @@ class ParZip4JvmTest : StringSpec({
}
}
}
)

0 comments on commit b8595b0

Please sign in to comment.