From cc9bd474b5435e4a7f5308f26c893ced72d6f651 Mon Sep 17 00:00:00 2001 From: Tejas Mate Date: Wed, 8 Nov 2023 22:15:32 +0500 Subject: [PATCH] Update NonFatalJvmTest.kt (#3277) --- .../src/jvmTest/java/arrow/core/NonFatalJvmTest.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/NonFatalJvmTest.kt b/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/NonFatalJvmTest.kt index a819be52fc9..cf6c7b9dee4 100644 --- a/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/NonFatalJvmTest.kt +++ b/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/NonFatalJvmTest.kt @@ -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 = listOf( InterruptedException(), @@ -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() } } } -}) +}