Skip to content

Commit

Permalink
refactor: migrate RaiseAccumulateSpec to kotlin-test (#3250)
Browse files Browse the repository at this point in the history
  • Loading branch information
milgner authored Nov 2, 2023
1 parent b8595b0 commit 1b8ec54
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package arrow.core.raise
import arrow.core.NonEmptyList
import arrow.core.left
import arrow.core.nonEmptyListOf
import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
import kotlin.test.Test
import kotlinx.coroutines.test.runTest

class RaiseAccumulateSpec : StringSpec({
"RaiseAccumulate takes precedence over extension function" {
class RaiseAccumulateSpec {
@Test fun raiseAccumulateTakesPrecedenceOverExtensionFunction() = runTest {
either<NonEmptyList<String>, Int> {
zipOrAccumulate(
{ ensure(false) { "false" } },
{ mapOrAccumulate(1..2) { ensure(false) { "$it: IsFalse" } } }
) { _, _ -> 1 }
} shouldBe nonEmptyListOf("false", "1: IsFalse", "2: IsFalse").left()
}
})
}

0 comments on commit 1b8ec54

Please sign in to comment.