@@ -77,19 +77,21 @@ class DispatcherSuite extends BaseSuite with DetectPlatform {
7777 D .use { dispatcher =>
7878 IO .ref(0 ).flatMap { ctr1 =>
7979 IO .ref(0 ).flatMap { ctr2 =>
80- IO .fromFuture(IO {
81- val (_, cancel) = dispatcher.unsafeToFutureCancelable(IO .uncancelable { _ =>
82- ctr1.update(_ + 1 ) *> IO .sleep(0.1 .second) *> ctr2.update(_ + 1 )
80+ IO .fromFuture(
81+ IO {
82+ val (_, cancel) = dispatcher.unsafeToFutureCancelable(IO .uncancelable { _ =>
83+ ctr1.update(_ + 1 ) *> IO .sleep(0.1 .second) *> ctr2.update(_ + 1 )
84+ })
85+ val cancelFut = cancel()
86+ cancelFut
8387 })
84- val cancelFut = cancel()
85- cancelFut
86- }).flatMap { _ =>
87- // if we're here, `cancel()` finished, so
88- // either the task didn't run at all (i.e.,
89- // it was cancelled before starting), or
90- // it ran and already finished completely:
91- (ctr1.get, ctr2.get).flatMapN { (v1, v2) => IO (assertEquals(v1, v2)) }
92- }
88+ .flatMap { _ =>
89+ // if we're here, `cancel()` finished, so
90+ // either the task didn't run at all (i.e.,
91+ // it was cancelled before starting), or
92+ // it ran and already finished completely:
93+ (ctr1.get, ctr2.get).flatMapN { (v1, v2) => IO (assertEquals(v1, v2)) }
94+ }
9395 }
9496 }
9597 }.replicateA_(if (isJVM) 10000 else 1 )
@@ -594,11 +596,12 @@ class DispatcherSuite extends BaseSuite with DetectPlatform {
594596
595597 real(" complete / cancel race" ) {
596598 val tsk = dispatcher.use { dispatcher =>
597- IO .fromFuture(IO {
598- val (_, cancel) = dispatcher.unsafeToFutureCancelable(IO .unit)
599- val cancelFut = cancel()
600- cancelFut
601- })
599+ IO .fromFuture(
600+ IO {
601+ val (_, cancel) = dispatcher.unsafeToFutureCancelable(IO .unit)
602+ val cancelFut = cancel()
603+ cancelFut
604+ })
602605 }
603606
604607 tsk.replicateA_(if (isJVM) 10000 else 1 )
0 commit comments