Skip to content

Commit

Permalink
implement test suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-thomson239 committed Sep 6, 2023
1 parent 71721f2 commit f549ec0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/shared/src/test/scala/cats/effect/IOSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,15 @@ class IOSpec extends BaseSpec with Discipline with IOPlatformSpecification {
}

"immediately surface fatal errors" in ticked { implicit ticker =>
import scala.util.control.NonFatal
val io = IO.raiseError[Unit](new VirtualMachineError {}).voidError
val error = new VirtualMachineError {}
val io = IO.raiseError[Unit](error).voidError

val fatalThrown =
try {
unsafeRun[Unit](io)
false
} catch {
case t if NonFatal(t) => false
case _: Throwable => true
case t: Throwable => t eq error
}
IO(fatalThrown) must completeAs(true)
}
Expand Down

0 comments on commit f549ec0

Please sign in to comment.