From f549ec0daa828e38723fe071b89f206738df31d4 Mon Sep 17 00:00:00 2001 From: Scott Thomson <110630636+scott-thomson239@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:35:06 +0100 Subject: [PATCH] implement test suggestion --- tests/shared/src/test/scala/cats/effect/IOSpec.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/shared/src/test/scala/cats/effect/IOSpec.scala b/tests/shared/src/test/scala/cats/effect/IOSpec.scala index 64caf5a1ba..538dbce557 100644 --- a/tests/shared/src/test/scala/cats/effect/IOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/IOSpec.scala @@ -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) }