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

Update NonFatalJvmTest.kt #3277

Merged
merged 1 commit into from
Nov 8, 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,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()
}
}
}
})
}
Loading