Skip to content

Commit

Permalink
Update NonFatalJvmTest.kt (#3277)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejas Mate authored Nov 8, 2023
1 parent 33adc3c commit cc9bd47
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package arrow.core

import io.kotest.assertions.throwables.shouldThrowAny
import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
import kotlin.test.Test
import kotlinx.coroutines.test.runTest

class NonFatalJvmTest : StringSpec({
class NonFatalJvmTest {
val fatals: List<Throwable> =
listOf(
InterruptedException(),
Expand All @@ -15,16 +16,17 @@ class NonFatalJvmTest : StringSpec({
},
)

"Test fatals using #invoke()" {
@Test fun testFatalsUsingInvoke() = runTest {
fatals.forEach {
NonFatal(it) shouldBe false
}
}
"Test fatals using Throwable#nonFatalOrThrow" {

@Test fun testFatalsUsingThrowableNonFatalOrThrow() = runTest {
fatals.forEach {
shouldThrowAny {
it.nonFatalOrThrow()
}
}
}
})
}

0 comments on commit cc9bd47

Please sign in to comment.