From 01b301efaeb80fdee1c6030026b0cd5d051ce99c Mon Sep 17 00:00:00 2001 From: Kevin Lee Date: Wed, 22 Nov 2023 21:17:42 +1100 Subject: [PATCH] Upgrade sbt and sbt plugins / Clean up * sbt to 1.9.7 * sbt-devoops to 3.0.0 * sbt-docusaur to 0.15.0 * Clean up the code as suggested by sbt-tpolecat --- .../effectie/resource/Ce2ResourceMaker.scala | 4 +- .../effectie/instances/ce2/canCatchSpec.scala | 3 +- .../instances/ce2/canHandleErrorSpec.scala | 15 +- .../instances/ce2/canRecoverSpec.scala | 11 +- .../effectie/instances/ce2/fxCtorSpec.scala | 3 - .../effectie/instances/ce2/fxSpec.scala | 13 +- .../effectie/instances/ce2/toFutureSpec.scala | 3 - .../scala-2/effectie/syntax/errorSpec.scala | 26 ++- .../test/scala-2/effectie/syntax/fxSpec.scala | 8 +- .../instances/ce2/CanRestartSpec.scala | 2 + .../instances/ce2/f/canCatchSpec.scala | 6 +- .../instances/ce2/f/canHandleErrorSpec.scala | 7 +- .../instances/ce2/f/canRecoverSpec.scala | 3 +- .../effectie/instances/ce2/f/fxCtorSpec.scala | 3 - .../effectie/instances/ce2/f/fxSpec.scala | 12 +- .../scala/effectie/syntax/restartSpec.scala | 1 + .../effectie/resource/Ce3ResourceMaker.scala | 4 +- .../effectie/instances/ce3/canCatchSpec.scala | 2 +- .../instances/ce3/canHandleErrorSpec.scala | 14 +- .../instances/ce3/canRecoverSpec.scala | 10 +- .../effectie/instances/ce3/fxCtorSpec.scala | 2 - .../effectie/instances/ce3/fxSpec.scala | 10 +- .../instances/ce3/testing/IoAppUtils.scala | 2 + .../effectie/instances/ce3/toFutureSpec.scala | 3 - .../scala-2/effectie/syntax/errorSpec.scala | 188 ++---------------- .../test/scala-2/effectie/syntax/fxSpec.scala | 8 +- .../instances/ce3/CanRestartSpec.scala | 2 + .../effectie/instances/ce3/MonadSpec.scala | 18 +- .../instances/ce3/f/canCatchSpec.scala | 3 +- .../instances/ce3/f/canHandleErrorSpec.scala | 14 +- .../instances/ce3/f/canRecoverSpec.scala | 3 +- .../effectie/instances/ce3/f/fxCtorSpec.scala | 2 - .../effectie/instances/ce3/f/fxSpec.scala | 10 +- .../scala/effectie/syntax/restartSpec.scala | 1 + .../effectie/instances/id/canCatchSpec.scala | 3 +- .../instances/id/canHandleErrorSpec.scala | 11 +- .../instances/id/canRecoverSpec.scala | 11 +- .../scala/effectie/instances/id/fxSpec.scala | 20 +- .../effectie/resource/ResourceMakerSpec.scala | 2 +- .../instances/future/canCatchSpec.scala | 3 +- .../effectie/instances/future/fxSpec.scala | 21 +- .../instances/tries/canCatchSpec.scala | 7 +- .../instances/tries/canHandleErrorSpec.scala | 10 +- .../instances/tries/canRecoverSpec.scala | 4 +- .../effectie/instances/tries/fxSpec.scala | 9 +- .../test/scala/effectie/specs/MonadSpec.scala | 2 +- .../effectie/specs/fxCtorSpec/TrySpecs.scala | 11 +- .../effectie/specs/fxSpec/TrySpecs.scala | 11 +- .../instances/monix3/CanRestartSpec.scala | 1 + .../effectie/instances/monix3/MonadSpec.scala | 2 +- .../instances/monix3/canCatchSpec.scala | 3 +- .../instances/monix3/canHandleErrorSpec.scala | 19 +- .../instances/monix3/canRecoverSpec.scala | 11 +- .../instances/monix3/fxCtorSpec.scala | 5 +- .../effectie/instances/monix3/fxSpec.scala | 9 +- .../instances/monix3/toFutureSpec.scala | 4 - .../scala/effectie/syntax/errorSpec.scala | 26 ++- .../test/scala/effectie/syntax/fxSpec.scala | 12 +- .../scala/effectie/syntax/restartSpec.scala | 1 + .../scala-2/effectie/syntax/errorSpec.scala | 15 +- .../scala/effectie/testing/cats/Laws.scala | 16 +- project/build.properties | 2 +- project/plugins.sbt | 4 +- 63 files changed, 260 insertions(+), 411 deletions(-) diff --git a/modules/effectie-cats-effect2/shared/src/main/scala/effectie/resource/Ce2ResourceMaker.scala b/modules/effectie-cats-effect2/shared/src/main/scala/effectie/resource/Ce2ResourceMaker.scala index 6bb75edd..cde135dc 100644 --- a/modules/effectie-cats-effect2/shared/src/main/scala/effectie/resource/Ce2ResourceMaker.scala +++ b/modules/effectie-cats-effect2/shared/src/main/scala/effectie/resource/Ce2ResourceMaker.scala @@ -11,9 +11,9 @@ object Ce2ResourceMaker { @deprecated(message = "Please use Ce2ResourceMaker.maker instead", since = "2.0.0-beta10") def forAutoCloseable[F[*]: Sync: BracketThrow]: ResourceMaker[F] = maker - def maker[F[*]: Sync: BracketThrow]: ResourceMaker[F] = new Ce2ResourceMaker[F] + def maker[F[*]: Sync]: ResourceMaker[F] = new Ce2ResourceMaker[F] - private final class Ce2ResourceMaker[F[*]: Sync: BracketThrow] extends ResourceMaker[F] { + private final class Ce2ResourceMaker[F[*]: Sync] extends ResourceMaker[F] { override def forAutoCloseable[A <: AutoCloseable](fa: F[A]): ReleasableResource[F, A] = Ce2Resource.fromAutoCloseable[F, A](fa) diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canCatchSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canCatchSpec.scala index 8d6ec79c..365367e8 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canCatchSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canCatchSpec.scala @@ -4,7 +4,6 @@ import canCatch._ import cats._ import cats.data.EitherT import cats.effect._ -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -168,7 +167,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canHandleErrorSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canHandleErrorSpec.scala index 71e708da..32bd7cc9 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canHandleErrorSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canHandleErrorSpec.scala @@ -4,7 +4,6 @@ import canHandleError._ import cats._ import cats.data.EitherT import cats.effect.IO -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -307,7 +306,7 @@ object canHandleErrorSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { @@ -321,6 +320,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } .unsafeRunSync() @@ -535,6 +536,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .unsafeRunSync() @@ -861,7 +864,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(err => Future(expected))) + )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -925,7 +928,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(err => Future(expected)).value) + )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1080,7 +1083,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatal(fa2)(err => expected)) + )(CanHandleError[Future].handleEitherNonFatal(fa2)(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1139,7 +1142,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatal(fa2)(err => expected).value) + )(CanHandleError[Future].handleEitherTNonFatal(fa2)(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canRecoverSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canRecoverSpec.scala index 1afea6d9..db749690 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canRecoverSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/canRecoverSpec.scala @@ -3,7 +3,6 @@ package effectie.instances.ce2 import cats._ import cats.data.EitherT import cats.effect.IO -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -309,7 +308,7 @@ object canRecoverSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IOSpec { @@ -964,7 +963,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } ) @@ -1042,7 +1041,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherTFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } .value ) @@ -1217,7 +1216,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err => expected }) + )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1285,7 +1284,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err => expected }.value) + )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxCtorSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxCtorSpec.scala index 9b7d86db..4f5f1e79 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxCtorSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxCtorSpec.scala @@ -3,7 +3,6 @@ package effectie.instances.ce2 import cats.effect._ import effectie.specs.fxCtorSpec.FxCtorSpecs import effectie.testing.tools -import extras.concurrent.testing.types.ErrorLogger import fxCtor._ import hedgehog._ import hedgehog.runner._ @@ -21,8 +20,6 @@ object fxCtorSpec extends Properties { (actual ==== expected).log(s"$actual does not equal to $expected") } - implicit private val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - private val unit: Unit = () private val ioSpecs = List( diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxSpec.scala index 9f91ef78..2dc335b7 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/fxSpec.scala @@ -3,7 +3,7 @@ package effectie.instances.ce2 import cats.data.EitherT import cats.effect._ import cats.syntax.all._ -import cats.{Eq, Functor} +import cats.Eq import effectie.SomeControlThrowable import effectie.core._ import effectie.instances.ce2.fx._ @@ -12,7 +12,6 @@ import effectie.specs.fxSpec.FxSpecs import effectie.syntax.error._ import effectie.testing.tools import effectie.testing.types.SomeError -import extras.concurrent.testing.types.ErrorLogger import hedgehog._ import hedgehog.runner._ @@ -25,8 +24,6 @@ object fxSpec extends Properties { override def tests: List[Test] = ioSpecs - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - private val assertWithAttempt: (IO[Int], Either[Throwable, Int]) => Result = { (io, expected) => val actual = io.attempt.unsafeRunSync() (actual ==== expected).log(s"$actual does not equal to $expected") @@ -371,7 +368,7 @@ object fxSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = Fx[F].effectOf(a) object IoSpec { @@ -382,8 +379,6 @@ object fxSpec extends Properties { implicit val eqIo: Eq[IO[Int]] = (x, y) => x.flatMap(xx => y.map(_ === xx)).unsafeRunSync() - implicit val ioFx: Fx[IO] = effectie.instances.ce2.fx.ioFx - MonadSpec.testMonadLaws[IO]("IO") } @@ -576,6 +571,8 @@ object fxSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } .unsafeRunSync() @@ -790,6 +787,8 @@ object fxSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .unsafeRunSync() diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/toFutureSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/toFutureSpec.scala index 93d32d83..b59f738c 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/toFutureSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/instances/ce2/toFutureSpec.scala @@ -41,9 +41,6 @@ object toFutureSpec extends Properties { val fa = IO(expected) implicit val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - @SuppressWarnings(Array("org.wartremover.warts.ExplicitImplicitTypes")) - implicit val ec = - ConcurrentSupport.newExecutionContextWithLogger(es, ErrorLogger.printlnExecutionContextErrorLogger) ConcurrentSupport.runAndShutdown(es, waitFor800Millis) { val future = ToFuture[IO].unsafeToFuture(fa) val ioResult = fa.unsafeRunSync() ==== expected diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/errorSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/errorSpec.scala index 0ccf216e..9cad586f 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/errorSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/errorSpec.scala @@ -191,7 +191,7 @@ object CanCatchSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { @@ -1069,7 +1069,7 @@ object CanHandleErrorSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { @@ -1083,6 +1083,8 @@ object CanHandleErrorSyntaxSpec { .handleNonFatalWith { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } .unsafeRunSync() @@ -1295,6 +1297,8 @@ object CanHandleErrorSyntaxSpec { .handleNonFatal { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .unsafeRunSync() @@ -1620,7 +1624,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatalWith(err => Future(expected))) + )(fa2.handleEitherNonFatalWith(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1679,7 +1683,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherTNonFatalWith(err => Future(expected)).value) + )(fa2.handleEitherTNonFatalWith(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1830,7 +1834,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatal(err => expected)) + )(fa2.handleEitherNonFatal(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1889,7 +1893,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherTNonFatal(err => expected).value) + )(fa2.handleEitherTNonFatal(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -2673,7 +2677,7 @@ object CanRecoverSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IOSpec { @@ -3312,7 +3316,7 @@ object CanRecoverSyntaxSpec { executorService, waitFor, )(fa2.recoverEitherFromNonFatalWith { - case err => Future(expected) + case err @ _ => Future(expected) }) actualFailedResult ==== expectedFailedResult and actual ==== expected @@ -3379,7 +3383,7 @@ object CanRecoverSyntaxSpec { executorService, waitFor, )(fa2.recoverEitherTFromNonFatalWith { - case err => Future(expected) + case err @ _ => Future(expected) }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected @@ -3543,7 +3547,7 @@ object CanRecoverSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.recoverEitherFromNonFatal { case err => expected }) + )(fa2.recoverEitherFromNonFatal { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -3606,7 +3610,7 @@ object CanRecoverSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.recoverEitherTFromNonFatal { case err => expected }.value) + )(fa2.recoverEitherTFromNonFatal { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/fxSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/fxSpec.scala index bfe841c7..eb4f1afe 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/fxSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala-2/effectie/syntax/fxSpec.scala @@ -114,8 +114,8 @@ object fxSpec extends Properties { _ <- pureOf[IO]({ actual2 = after; () }) n <- eftClient.eftOf(1) n2 <- eftClient.of(n) - i <- effectConstructorClient.eftOf(1) - i2 <- effectConstructorClient.of(1) + i <- effectConstructorClient.eftOf(n2) + _ <- effectConstructorClient.of(i) _ <- eftClient.unit _ <- effectConstructorClient.unit } yield () @@ -406,8 +406,8 @@ object fxSpec extends Properties { _ <- pureOf[Future]({ actual2 = after; () }) n <- eftClient.eftOf(1) n2 <- eftClient.of(n) - i <- effectConstructorClient.eftOf(1) - i2 <- effectConstructorClient.of(1) + i <- effectConstructorClient.eftOf(n2) + _ <- effectConstructorClient.of(i) _ <- eftClient.unit _ <- effectConstructorClient.unit } yield () diff --git a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/CanRestartSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/CanRestartSpec.scala index 0de09728..533ef466 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/CanRestartSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/CanRestartSpec.scala @@ -185,6 +185,7 @@ object CanRestartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { @@ -220,6 +221,7 @@ object CanRestartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { diff --git a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canCatchSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canCatchSpec.scala index 5f9b132f..99a4eb4b 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canCatchSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canCatchSpec.scala @@ -1,6 +1,5 @@ package effectie.instances.ce2.f -import cats._ import cats.data.EitherT import cats.effect._ import cats.syntax.all._ @@ -10,7 +9,6 @@ import effectie.instances.ce2.f.canCatch.syncCanCatch import effectie.syntax.error._ import effectie.syntax.fx._ import effectie.testing.types._ -import extras.concurrent.testing.types.ErrorLogger import fxCtor._ import hedgehog._ import hedgehog.runner._ @@ -20,8 +18,6 @@ import hedgehog.runner._ */ object canCatchSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - override def tests: List[Test] = ioSpecs val ioSpecs = List( @@ -88,7 +84,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { diff --git a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canHandleErrorSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canHandleErrorSpec.scala index 3c6e3a3f..58cd3064 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canHandleErrorSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canHandleErrorSpec.scala @@ -1,7 +1,6 @@ package effectie.instances.ce2.f import effectie.instances.ce2.f.canHandleError.syncCanHandleError -import cats._ import cats.data.EitherT import cats.effect.IO import cats.syntax.all._ @@ -153,7 +152,7 @@ object canHandleErrorSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { @@ -167,6 +166,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } .unsafeRunSync() @@ -381,6 +382,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .unsafeRunSync() diff --git a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canRecoverSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canRecoverSpec.scala index 43fd2ae5..763b5195 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canRecoverSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/canRecoverSpec.scala @@ -1,6 +1,5 @@ package effectie.instances.ce2.f -import cats._ import cats.data.EitherT import cats.effect.IO import cats.syntax.all._ @@ -152,7 +151,7 @@ object canRecoverSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IOSpec { diff --git a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxCtorSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxCtorSpec.scala index 9820e4e1..02545698 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxCtorSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxCtorSpec.scala @@ -4,7 +4,6 @@ import cats.effect._ import effectie.specs.fxCtorSpec.FxCtorSpecs import effectie.testing.tools import effectie.instances.ce2.f.fxCtor.syncFxCtor -import extras.concurrent.testing.types.ErrorLogger import hedgehog._ import hedgehog.runner._ @@ -21,8 +20,6 @@ object fxCtorSpec extends Properties { (actual ==== expected).log(s"$actual does not equal to $expected") } - implicit private val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - private val unit: Unit = () private val ioSpecs = List( diff --git a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxSpec.scala index 6ab9ce38..dd5fe4ad 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/instances/ce2/f/fxSpec.scala @@ -3,7 +3,7 @@ package effectie.instances.ce2.f import cats.data.EitherT import cats.effect._ import cats.syntax.all._ -import cats.{Eq, Functor} +import cats.Eq import effectie.SomeControlThrowable import effectie.core._ import effectie.instances.ce2.f.fx.syncFx @@ -12,7 +12,6 @@ import effectie.specs.fxSpec.FxSpecs import effectie.syntax.error._ import effectie.testing.tools import effectie.testing.types.SomeError -import extras.concurrent.testing.types.ErrorLogger import hedgehog._ import hedgehog.runner._ @@ -25,8 +24,6 @@ object fxSpec extends Properties { override def tests: List[Test] = ioSpecs - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - private val assertWithAttempt: (IO[Int], Either[Throwable, Int]) => Result = { (io, expected) => val actual = io.attempt.unsafeRunSync() (actual ==== expected).log(s"$actual does not equal to $expected") @@ -371,7 +368,7 @@ object fxSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = Fx[F].effectOf(a) object IoSpec { @@ -574,6 +571,8 @@ object fxSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } .unsafeRunSync() @@ -788,6 +787,9 @@ object fxSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + + case err => + throw err } .unsafeRunSync() diff --git a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/syntax/restartSpec.scala b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/syntax/restartSpec.scala index ca8431a3..5a8b17ab 100644 --- a/modules/effectie-cats-effect2/shared/src/test/scala/effectie/syntax/restartSpec.scala +++ b/modules/effectie-cats-effect2/shared/src/test/scala/effectie/syntax/restartSpec.scala @@ -135,6 +135,7 @@ object restartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { diff --git a/modules/effectie-cats-effect3/shared/src/main/scala/effectie/resource/Ce3ResourceMaker.scala b/modules/effectie-cats-effect3/shared/src/main/scala/effectie/resource/Ce3ResourceMaker.scala index 4f986453..cd219001 100644 --- a/modules/effectie-cats-effect3/shared/src/main/scala/effectie/resource/Ce3ResourceMaker.scala +++ b/modules/effectie-cats-effect3/shared/src/main/scala/effectie/resource/Ce3ResourceMaker.scala @@ -12,9 +12,9 @@ object Ce3ResourceMaker { @deprecated(message = "Please use Ce3ResourceMaker.maker instead", since = "2.0.0-beta10") def forAutoCloseable[F[*]: Sync: MonadCancelThrow]: ResourceMaker[F] = maker - def maker[F[*]: Sync: MonadCancelThrow]: ResourceMaker[F] = new Ce3ResourceMaker[F] + def maker[F[*]: Sync]: ResourceMaker[F] = new Ce3ResourceMaker[F] - private final class Ce3ResourceMaker[F[*]: Sync: MonadCancelThrow] extends ResourceMaker[F] { + private final class Ce3ResourceMaker[F[*]: Sync] extends ResourceMaker[F] { override def forAutoCloseable[A <: AutoCloseable](fa: F[A]): ReleasableResource[F, A] = Ce3Resource.fromAutoCloseable[F, A](fa) diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canCatchSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canCatchSpec.scala index 9621dfc4..789461ad 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canCatchSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canCatchSpec.scala @@ -170,7 +170,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canHandleErrorSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canHandleErrorSpec.scala index 8949116c..32291d61 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canHandleErrorSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canHandleErrorSpec.scala @@ -312,7 +312,7 @@ object canHandleErrorSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { @@ -326,6 +326,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } actual.completeAs(expected) @@ -552,6 +554,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } actual.completeAs(expected) @@ -889,7 +893,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(err => Future(expected))) + )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -953,7 +957,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(err => Future(expected)).value) + )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1108,7 +1112,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatal(fa2)(err => expected)) + )(CanHandleError[Future].handleEitherNonFatal(fa2)(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1167,7 +1171,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatal(fa2)(err => expected).value) + )(CanHandleError[Future].handleEitherTNonFatal(fa2)(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canRecoverSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canRecoverSpec.scala index 83f454dd..e4f99547 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canRecoverSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/canRecoverSpec.scala @@ -314,7 +314,7 @@ object canRecoverSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IOSpec { @@ -973,7 +973,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } ) @@ -1051,7 +1051,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherTFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } .value ) @@ -1226,7 +1226,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err => expected }) + )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1294,7 +1294,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err => expected }.value) + )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxCtorSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxCtorSpec.scala index bf6273e3..8ec59958 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxCtorSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxCtorSpec.scala @@ -2,7 +2,6 @@ package effectie.instances.ce3 import cats.effect._ import effectie.specs.fxCtorSpec.FxCtorSpecs -import extras.concurrent.testing.types.ErrorLogger import extras.hedgehog.ce3.syntax.runner._ import fxCtor._ import hedgehog._ @@ -12,7 +11,6 @@ import hedgehog.runner._ * @since 2020-12-06 */ object fxCtorSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger override def tests: List[Test] = ioSpecs diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxSpec.scala index 087df61e..5eb41859 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/fxSpec.scala @@ -4,7 +4,7 @@ import cats.data.EitherT import cats.effect._ import cats.effect.unsafe.IORuntime import cats.syntax.all._ -import cats.{Eq, Functor} +import cats.Eq import effectie.SomeControlThrowable import effectie.core._ import effectie.instances.ce3.compat.CatsEffectIoCompatForFuture @@ -12,7 +12,6 @@ import effectie.specs.fxSpec.FxSpecs import effectie.syntax.error._ import effectie.testing.types.SomeError import extras.concurrent.testing.ConcurrentSupport -import extras.concurrent.testing.types.ErrorLogger import extras.hedgehog.ce3.syntax.runner._ import fx._ import hedgehog._ @@ -25,7 +24,6 @@ import scala.util.control.{ControlThrowable, NonFatal} * @since 2020-12-06 */ object fxSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger private val assertWithAttempt: (IO[Int], Either[Throwable, Int]) => Result = { (ioA, expected) => withIO { implicit ticker => @@ -434,7 +432,7 @@ object fxSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = Fx[F].effectOf(a) object IoSpec { @@ -730,6 +728,8 @@ object fxSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } actual.completeAs(expected) @@ -958,6 +958,8 @@ object fxSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } actual.completeAs(expected) diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/testing/IoAppUtils.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/testing/IoAppUtils.scala index 01d960e6..387d0fb9 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/testing/IoAppUtils.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/testing/IoAppUtils.scala @@ -4,6 +4,7 @@ import cats.effect.unsafe.{IORuntime, IORuntimeConfig} import hedgehog.core.Result import java.util.concurrent.ExecutorService +import scala.annotation.nowarn /** @author Kevin Lee * @since 2021-07-22 @@ -21,6 +22,7 @@ object IoAppUtils { num } + @nowarn def runtime(es: ExecutorService): IORuntime = runtime() def runtime(): IORuntime = { diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/toFutureSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/toFutureSpec.scala index 428eebc0..9be69a14 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/toFutureSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/instances/ce3/toFutureSpec.scala @@ -41,9 +41,6 @@ object toFutureSpec extends Properties { val fa = IO(expected) implicit val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - @SuppressWarnings(Array("org.wartremover.warts.ExplicitImplicitTypes")) - implicit val ec = - ConcurrentSupport.newExecutionContextWithLogger(es, ErrorLogger.printlnExecutionContextErrorLogger) ConcurrentSupport.runAndShutdown(es, WaitFor(800.milliseconds)) { implicit val ticket: Ticker = Ticker.withNewTestContext() diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/errorSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/errorSpec.scala index 6dce474f..4f9f6900 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/errorSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/errorSpec.scala @@ -10,7 +10,6 @@ import effectie.core.Fx import effectie.instances.ce3.compat.CatsEffectIoCompatForFuture import effectie.instances.ce3.fx._ import effectie.instances.ce3.testing -import effectie.instances.ce3.testing.IoAppUtils import effectie.syntax.error._ import effectie.syntax.fx._ import effectie.testing.types.SomeError @@ -197,16 +196,13 @@ object CanCatchSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object IoSpec { def testCanCatch_IO_catchNonFatalThrowableShouldCatchNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Int](throwThrowable[Int](expectedExpcetion)) val expected = expectedExpcetion.asLeft[Int] @@ -239,9 +235,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalThrowableShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa: IO[Int] = run[IO, Int](1) val expected = 1.asRight[Throwable] val actual = fa.catchNonFatalThrowable @@ -251,9 +244,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalShouldCatchNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Int](throwThrowable[Int](expectedExpcetion)) val expected = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -286,9 +276,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa: IO[Int] = run[IO, Int](1) val expected = 1.asRight[SomeError] val actual = fa.catchNonFatal(SomeError.someThrowable) @@ -298,9 +285,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalEitherShouldCatchNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expected = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -333,9 +317,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalEitherShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = fa.catchNonFatalEither(SomeError.someThrowable) @@ -345,9 +326,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalEitherShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -358,9 +336,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalEitherTShouldCatchNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = EitherT(run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion))) val expected = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -393,9 +368,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalEitherTShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = EitherT(run[IO, Either[SomeError, Int]](1.asRight[SomeError])) val expected = 1.asRight[SomeError] val actual = fa.catchNonFatalEitherT(SomeError.someThrowable).value @@ -405,9 +377,6 @@ object CanCatchSyntaxSpec { def testCanCatch_IO_catchNonFatalEitherTShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = EitherT(run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int])) val expected = expectedFailure.asLeft[Int] @@ -1115,16 +1084,13 @@ object CanHandleErrorSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object IoSpec { def testCanHandleError_IO_handleNonFatalWithShouldHandleNonFatalWith: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Int](throwThrowable[Int](expectedExpcetion)) val expected = 123 @@ -1132,6 +1098,8 @@ object CanHandleErrorSyntaxSpec { .handleNonFatalWith { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } actual.completeAs(expected) } @@ -1160,9 +1128,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalWithShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = run[IO, Int](1) val expected = 1 val actual = fa.handleNonFatalWith(_ => IO.pure(999)) @@ -1171,9 +1136,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalWithEitherShouldHandleNonFatalWith: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expectedFailedResult = SomeError.message("Recovered Error").asLeft[Int] @@ -1210,9 +1172,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalWithEitherShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = fa.handleNonFatalWith(_ => IO(999.asRight[SomeError])) @@ -1221,9 +1180,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalWithEitherShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -1233,9 +1189,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherNonFatalWithShouldHandleNonFatalWith: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -1275,9 +1228,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherNonFatalWithShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = @@ -1287,9 +1237,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherNonFatalWithShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -1300,9 +1247,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherTNonFatalWithShouldHandleNonFatalWith: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = EitherT(run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion))) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -1345,9 +1289,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherTNonFatalWithShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = EitherT(run[IO, Either[SomeError, Int]](1.asRight[SomeError])) val expected = 1.asRight[SomeError] val actual = @@ -1357,9 +1298,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherTNonFatalWithShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = EitherT(run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int])) val expected = expectedFailure.asLeft[Int] @@ -1370,9 +1308,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalShouldHandleNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Int](throwThrowable[Int](expectedExpcetion)) val expected = 123 @@ -1380,6 +1315,8 @@ object CanHandleErrorSyntaxSpec { .handleNonFatal { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } actual.completeAs(expected) } @@ -1408,9 +1345,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = run[IO, Int](1) val expected = 1 val actual = fa.handleNonFatal(_ => 999) @@ -1419,9 +1353,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalEitherShouldHandleNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expectedFailedResult = SomeError.message("Recovered Error").asLeft[Int] @@ -1457,9 +1388,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalEitherShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = fa.handleNonFatal(_ => 999.asRight[SomeError]) @@ -1468,9 +1396,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleNonFatalEitherShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -1480,9 +1405,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherNonFatalShouldHandleNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -1521,9 +1443,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherNonFatalShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = fa.handleEitherNonFatal(_ => 123.asRight[SomeError]) @@ -1532,9 +1451,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherNonFatalShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -1545,9 +1461,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherTNonFatalShouldHandleNonFatal: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = EitherT(run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion))) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -1586,9 +1499,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherTNonFatalShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val fa = EitherT(run[IO, Either[SomeError, Int]](1.asRight[SomeError])) val expected = 1.asRight[SomeError] val actual = fa.handleEitherTNonFatal(_ => 123.asRight[SomeError]).value @@ -1597,9 +1507,6 @@ object CanHandleErrorSyntaxSpec { def testCanHandleError_IO_handleEitherTNonFatalShouldReturnFailedResult: Result = withIO { implicit ticker => - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expectedFailure = SomeError.message("Failed") val fa = EitherT(run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int])) val expected = expectedFailure.asLeft[Int] @@ -1733,7 +1640,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatalWith(err => Future(expected))) + )(fa2.handleEitherNonFatalWith(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1792,7 +1699,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherTNonFatalWith(err => Future(expected)).value) + )(fa2.handleEitherTNonFatalWith(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1943,7 +1850,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatal(err => expected)) + )(fa2.handleEitherNonFatal(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -2002,7 +1909,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherTNonFatal(err => expected).value) + )(fa2.handleEitherTNonFatal(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -2785,16 +2692,13 @@ object CanRecoverSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object IOSpec { def testCanRecover_IO_recoverFromNonFatalWithShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Int](throwThrowable[Int](expectedExpcetion)) val expected = 123 @@ -2830,9 +2734,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalWithShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = run[IO, Int](1) val expected = 1 val actual = fa @@ -2843,8 +2744,6 @@ object CanRecoverSyntaxSpec { } def testCanRecover_IO_recoverFromNonFatalWithEitherShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) @@ -2889,9 +2788,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalWithEitherShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = fa @@ -2903,9 +2799,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalWithEitherShouldReturnFailedResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -2918,9 +2811,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherFromNonFatalWithShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -2964,9 +2854,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherFromNonFatalWithShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = fa @@ -2978,9 +2865,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherFromNonFatalWithShouldReturnFailedResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -2993,9 +2877,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherTFromNonFatalWithShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = EitherT(run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion))) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -3039,9 +2920,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherTFromNonFatalWithShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = EitherT(run[IO, Either[SomeError, Int]](1.asRight[SomeError])) val expected = 1.asRight[SomeError] val actual = fa.recoverEitherTFromNonFatalWith { @@ -3052,9 +2930,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherTFromNonFatalWithShouldReturnFailedResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedFailure = SomeError.message("Failed") val fa = EitherT(run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int])) val expected = expectedFailure.asLeft[Int] @@ -3069,9 +2944,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Int](throwThrowable[Int](expectedExpcetion)) val expected = 123 @@ -3108,9 +2980,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = run[IO, Int](1) val expected = 1 val actual = fa.recoverFromNonFatal { case NonFatal(_) => 999 } @@ -3119,9 +2988,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalEitherShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expectedFailedResult = SomeError.message("Recovered Error").asLeft[Int] @@ -3158,9 +3024,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalEitherShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = fa.recoverFromNonFatal { case NonFatal(_) => 999.asRight[SomeError] } @@ -3169,9 +3032,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverFromNonFatalEitherShouldReturnFailedResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -3181,9 +3041,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherFromNonFatalShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion)) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -3227,9 +3084,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherFromNonFatalShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = run[IO, Either[SomeError, Int]](1.asRight[SomeError]) val expected = 1.asRight[SomeError] val actual = @@ -3239,9 +3093,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherFromNonFatalShouldReturnFailedResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedFailure = SomeError.message("Failed") val fa = run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int]) val expected = expectedFailure.asLeft[Int] @@ -3252,9 +3103,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherTFromNonFatalShouldRecoverFromNonFatal: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedExpcetion = new RuntimeException("Something's wrong") val fa = EitherT(run[IO, Either[SomeError, Int]](throwThrowable[Either[SomeError, Int]](expectedExpcetion))) val expectedFailedResult = SomeError.someThrowable(expectedExpcetion).asLeft[Int] @@ -3298,9 +3146,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherTFromNonFatalShouldReturnSuccessfulResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val fa = EitherT(run[IO, Either[SomeError, Int]](1.asRight[SomeError])) val expected = 1.asRight[SomeError] val actual = @@ -3310,9 +3155,6 @@ object CanRecoverSyntaxSpec { def testCanRecover_IO_recoverEitherTFromNonFatalShouldReturnFailedResult: Result = withIO { implicit ticker => - val compat = new CatsEffectIoCompatForFuture - implicit val rt: IORuntime = testing.IoAppUtils.runtime(compat.es) - val expectedFailure = SomeError.message("Failed") val fa = EitherT(run[IO, Either[SomeError, Int]](expectedFailure.asLeft[Int])) val expected = expectedFailure.asLeft[Int] @@ -3463,7 +3305,7 @@ object CanRecoverSyntaxSpec { executorService, waitFor, )(fa2.recoverEitherFromNonFatalWith { - case err => Future(expected) + case err @ _ => Future(expected) }) actualFailedResult ==== expectedFailedResult and actual ==== expected @@ -3530,7 +3372,7 @@ object CanRecoverSyntaxSpec { executorService, waitFor, )(fa2.recoverEitherTFromNonFatalWith { - case err => Future(expected) + case err @ _ => Future(expected) }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected @@ -3697,7 +3539,7 @@ object CanRecoverSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.recoverEitherFromNonFatal { case err => expected }) + )(fa2.recoverEitherFromNonFatal { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -3760,7 +3602,7 @@ object CanRecoverSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.recoverEitherTFromNonFatal { case err => expected }.value) + )(fa2.recoverEitherTFromNonFatal { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/fxSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/fxSpec.scala index 1e8b84c1..61a09dce 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/fxSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala-2/effectie/syntax/fxSpec.scala @@ -125,8 +125,8 @@ object fxSpec extends Properties { _ <- pureOf[IO]({ actual2 = after; () }) n <- eftClient.eftOf(1) n2 <- eftClient.of(n) - i <- effectConstructorClient.eftOf(1) - i2 <- effectConstructorClient.of(1) + i <- effectConstructorClient.eftOf(n2) + _ <- effectConstructorClient.of(i) _ <- eftClient.unit _ <- effectConstructorClient.unit } yield () @@ -386,8 +386,8 @@ object fxSpec extends Properties { _ <- pureOf[Future]({ actual2 = after; () }) n <- eftClient.eftOf(1) n2 <- eftClient.of(n) - i <- effectConstructorClient.eftOf(1) - i2 <- effectConstructorClient.of(1) + i <- effectConstructorClient.eftOf(n2) + _ <- effectConstructorClient.of(i) _ <- eftClient.unit _ <- effectConstructorClient.unit } yield () diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/CanRestartSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/CanRestartSpec.scala index f348dfdb..d6bbe6b0 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/CanRestartSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/CanRestartSpec.scala @@ -187,6 +187,7 @@ object CanRestartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { @@ -224,6 +225,7 @@ object CanRestartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/MonadSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/MonadSpec.scala index c06439cf..76ff8dc2 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/MonadSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/MonadSpec.scala @@ -8,14 +8,14 @@ object MonadSpec { type Fx[F[*]] = effectie.core.Fx[F] - def test1_Identity[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test1_Identity[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .identity[F]( Gens.genFA[F, Int](Gens.genInt(Int.MinValue, Int.MaxValue)) ) - def test2_Composition[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test2_Composition[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .composition[F]( @@ -23,14 +23,14 @@ object MonadSpec { Gens.genIntToInt, ) - def test3_IdentityAp[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test3_IdentityAp[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .identityAp[F]( Gens.genFA[F, Int](Gens.genInt(Int.MinValue, Int.MaxValue)) ) - def test4_Homomorphism[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test4_Homomorphism[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .homomorphism[F]( @@ -38,7 +38,7 @@ object MonadSpec { Gens.genIntToInt, ) - def test5_Interchange[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test5_Interchange[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .interchange[F]( @@ -46,7 +46,7 @@ object MonadSpec { Gens.genIntToInt, ) - def test6_CompositionAp[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test6_CompositionAp[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .compositionAp[F]( @@ -54,7 +54,7 @@ object MonadSpec { Gens.genIntToInt, ) - def test7_LeftIdentity[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test7_LeftIdentity[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .leftIdentity[F]( @@ -62,14 +62,14 @@ object MonadSpec { Gens.genAToMonadA(Gens.genIntToInt), ) - def test8_RightIdentity[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test8_RightIdentity[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .rightIdentity[F]( Gens.genFA[F, Int](Gens.genInt(Int.MinValue, Int.MaxValue)) ) - def test9_Associativity[F[*]: Fx: Monad](implicit eqF: Eq[F[Int]]): Property = + def test9_Associativity[F[*]: Monad](implicit eqF: Eq[F[Int]]): Property = Specs .MonadLaws .associativity[F]( diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canCatchSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canCatchSpec.scala index c388d07d..acb5d1fc 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canCatchSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canCatchSpec.scala @@ -1,7 +1,6 @@ package effectie.instances.ce3.f import effectie.instances.ce3.f.canCatch._ -import cats._ import cats.data.EitherT import cats.effect._ import cats.instances.all._ @@ -94,7 +93,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canHandleErrorSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canHandleErrorSpec.scala index 7c50b8d3..72d8035f 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canHandleErrorSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canHandleErrorSpec.scala @@ -313,7 +313,7 @@ object canHandleErrorSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IoSpec { @@ -327,6 +327,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } actual.completeAs(expected) @@ -553,6 +555,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } actual.completeAs(expected) @@ -890,7 +894,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(err => Future(expected))) + )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -954,7 +958,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(err => Future(expected)).value) + )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1109,7 +1113,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatal(fa2)(err => expected)) + )(CanHandleError[Future].handleEitherNonFatal(fa2)(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1168,7 +1172,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatal(fa2)(err => expected).value) + )(CanHandleError[Future].handleEitherTNonFatal(fa2)(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canRecoverSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canRecoverSpec.scala index 75f414fe..0671837d 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canRecoverSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/canRecoverSpec.scala @@ -1,7 +1,6 @@ package effectie.instances.ce3.f import canRecover._ -import cats._ import cats.data.EitherT import cats.effect.IO import cats.effect.unsafe.IORuntime @@ -159,7 +158,7 @@ object canRecoverSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object IOSpec { diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxCtorSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxCtorSpec.scala index cc32d7f4..efa94f4b 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxCtorSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxCtorSpec.scala @@ -2,7 +2,6 @@ package effectie.instances.ce3.f import cats.effect._ import effectie.specs.fxCtorSpec.FxCtorSpecs -import extras.concurrent.testing.types.ErrorLogger import extras.hedgehog.ce3.syntax.runner._ import fxCtor._ import hedgehog._ @@ -12,7 +11,6 @@ import hedgehog.runner._ * @since 2020-12-06 */ object fxCtorSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger override def tests: List[Test] = ioSpecs diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxSpec.scala index a0077a8a..1d6b8214 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/instances/ce3/f/fxSpec.scala @@ -4,7 +4,7 @@ import cats.data.EitherT import cats.effect._ import cats.effect.unsafe.IORuntime import cats.syntax.all._ -import cats.{Eq, Functor} +import cats.Eq import effectie.SomeControlThrowable import effectie.core._ import effectie.instances.ce3.compat.CatsEffectIoCompatForFuture @@ -14,7 +14,6 @@ import effectie.specs.fxSpec.FxSpecs import effectie.syntax.error._ import effectie.testing.types.SomeError import extras.concurrent.testing.ConcurrentSupport -import extras.concurrent.testing.types.ErrorLogger import extras.hedgehog.ce3.syntax.runner._ import fx._ import hedgehog._ @@ -27,7 +26,6 @@ import scala.util.control.{ControlThrowable, NonFatal} * @since 2020-12-06 */ object fxSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger private val assertWithAttempt: (IO[Int], Either[Throwable, Int]) => Result = { (ioA, expected) => withIO { implicit ticker => @@ -436,7 +434,7 @@ object fxSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = Fx[F].effectOf(a) object IoSpec { @@ -732,6 +730,8 @@ object fxSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } actual.completeAs(expected) @@ -960,6 +960,8 @@ object fxSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } actual.completeAs(expected) diff --git a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/syntax/restartSpec.scala b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/syntax/restartSpec.scala index ca3273d1..700c8259 100644 --- a/modules/effectie-cats-effect3/shared/src/test/scala/effectie/syntax/restartSpec.scala +++ b/modules/effectie-cats-effect3/shared/src/test/scala/effectie/syntax/restartSpec.scala @@ -134,6 +134,7 @@ object restartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { diff --git a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canCatchSpec.scala b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canCatchSpec.scala index d1c25c48..e500e467 100644 --- a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canCatchSpec.scala +++ b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canCatchSpec.scala @@ -3,7 +3,6 @@ package effectie.instances.id import canCatch._ import cats._ import cats.data.EitherT -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -106,7 +105,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = FxCtor[F].effectOf(a) object FutureSpec { diff --git a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canHandleErrorSpec.scala b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canHandleErrorSpec.scala index aac1d9ce..37c9309e 100644 --- a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canHandleErrorSpec.scala +++ b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canHandleErrorSpec.scala @@ -3,7 +3,6 @@ package effectie.instances.id import canHandleError._ import cats._ import cats.data.EitherT -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -181,7 +180,7 @@ object canHandleErrorSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = FxCtor[F].effectOf(a) object FutureSpec { @@ -307,7 +306,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(err => Future(expected))) + )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -371,7 +370,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(err => Future(expected)).value) + )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -526,7 +525,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatal(fa2)(err => expected)) + )(CanHandleError[Future].handleEitherNonFatal(fa2)(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -585,7 +584,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatal(fa2)(err => expected).value) + )(CanHandleError[Future].handleEitherTNonFatal(fa2)(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canRecoverSpec.scala b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canRecoverSpec.scala index 628c101c..f33a105c 100644 --- a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canRecoverSpec.scala +++ b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/canRecoverSpec.scala @@ -2,7 +2,6 @@ package effectie.instances.id import cats._ import cats.data.EitherT -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -182,7 +181,7 @@ object canRecoverSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = FxCtor[F].effectOf(a) object FutureSpec { @@ -328,7 +327,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } ) @@ -406,7 +405,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherTFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } .value ) @@ -581,7 +580,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err => expected }) + )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -649,7 +648,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err => expected }.value) + )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/fxSpec.scala b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/fxSpec.scala index cfd48acb..2fe7d086 100644 --- a/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/fxSpec.scala +++ b/modules/effectie-cats/shared/src/test/scala/effectie/instances/id/fxSpec.scala @@ -2,16 +2,15 @@ package effectie.instances.id import cats.data.EitherT import cats.syntax.all._ -import cats.{Functor, Id, Monad} -import effectie.SomeControlThrowable +import cats.Id import effectie.core._ +import effectie.instances.id.fx._ +import effectie.{SomeControlThrowable, specs} import effectie.specs.MonadSpec -import effectie.specs import effectie.syntax.all._ import effectie.testing.types.SomeError import extras.concurrent.testing.ConcurrentSupport import extras.concurrent.testing.types.{ErrorLogger, WaitFor} -import fx._ import hedgehog._ import hedgehog.runner._ @@ -26,8 +25,6 @@ object fxSpec extends Properties { private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - private val unit: Unit = () - /* Future */ private val futureSpecs = effectie.instances.future.fxSpec.futureSpecs ++ List( @@ -406,7 +403,7 @@ object fxSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = Fx[F].effectOf(a) object FutureSpec { @@ -499,7 +496,7 @@ object fxSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(Fx[Future].handleEitherTNonFatalWith(fa2)(err => Future(expected)).value) + )(Fx[Future].handleEitherTNonFatalWith(fa2)(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -564,7 +561,7 @@ object fxSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(Fx[Future].handleEitherTNonFatal(fa2)(err => expected).value) + )(Fx[Future].handleEitherTNonFatal(fa2)(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -640,7 +637,7 @@ object fxSpec extends Properties { )( Fx[Future] .recoverEitherTFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } .value ) @@ -722,7 +719,7 @@ object fxSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(Fx[Future].recoverEitherTFromNonFatal(fa2) { case err => expected }.value) + )(Fx[Future].recoverEitherTFromNonFatal(fa2) { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -773,7 +770,6 @@ object fxSpec extends Properties { object IdSpec { def testMonadLaws: List[Test] = { - val idInstance: Monad[Id] = cats.catsInstancesForId MonadSpec.testMonadLaws[Id]("Id") } diff --git a/modules/effectie-cats/shared/src/test/scala/effectie/resource/ResourceMakerSpec.scala b/modules/effectie-cats/shared/src/test/scala/effectie/resource/ResourceMakerSpec.scala index 6198091c..a4c3b081 100644 --- a/modules/effectie-cats/shared/src/test/scala/effectie/resource/ResourceMakerSpec.scala +++ b/modules/effectie-cats/shared/src/test/scala/effectie/resource/ResourceMakerSpec.scala @@ -150,7 +150,7 @@ object ResourceMakerSpec { CanCatch[F] .catchNonFatal( ResourceMaker[F] - .make(FxCtor[F].effectOf(testResource))(a => FxCtor[F].effectOf(release(testResource))) + .make(FxCtor[F].effectOf(testResource))(a => FxCtor[F].effectOf(release(a))) .use { resource => for { _ <- FxCtor[F].effectOf { diff --git a/modules/effectie-core/shared/src/test/scala/effectie/instances/future/canCatchSpec.scala b/modules/effectie-core/shared/src/test/scala/effectie/instances/future/canCatchSpec.scala index 938168a2..633225b8 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/instances/future/canCatchSpec.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/instances/future/canCatchSpec.scala @@ -1,6 +1,5 @@ package effectie.instances.future -import cats.Functor import effectie.core.{CanCatch, FxCtor} import effectie.testing.types.SomeError import extras.concurrent.testing.ConcurrentSupport @@ -51,7 +50,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = FxCtor[F].effectOf(a) object FutureSpec { diff --git a/modules/effectie-core/shared/src/test/scala/effectie/instances/future/fxSpec.scala b/modules/effectie-core/shared/src/test/scala/effectie/instances/future/fxSpec.scala index 9afbd65f..0398b9fe 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/instances/future/fxSpec.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/instances/future/fxSpec.scala @@ -257,7 +257,8 @@ object fxSpec extends Properties { var actual = before // scalafix:ok DisableSyntax.var val testBefore = actual ==== before val fromFuture = Fx[Future].fromEffect(Fx[Future].effectOf({ actual = after; () })) - val testAfterFrom = actual ==== before + Thread.sleep(10L) + val testAfterFrom = actual ==== after ConcurrentSupport.futureToValueAndTerminate(executorService, waitFor)(fromFuture) val testAfterRun = actual ==== after Result.all( @@ -588,11 +589,11 @@ object fxSpec extends Properties { Await.result(x.flatMap(a => y.map(b => EQ.eqv(a, b))), 1.second) } - implicit val eqFuture: Eq[Future[Int]] = - (x, y) => { - val future = x.flatMap(xx => y.map(_ === xx)) - Await.result(future, waitFor.waitFor) - } +// implicit val eqFuture: Eq[Future[Int]] = +// (x, y) => { +// val future = x.flatMap(xx => y.map(_ === xx)) +// Await.result(future, waitFor.waitFor) +// } MonadSpec.testAllLaws[Future]("Fx[Future]") } @@ -844,7 +845,7 @@ object fxSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(Fx[Future].handleEitherNonFatalWith(fa2)(err => Future(expected))) + )(Fx[Future].handleEitherNonFatalWith(fa2)(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -995,7 +996,7 @@ object fxSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(Fx[Future].handleEitherNonFatal(fa2)(err => expected)) + )(Fx[Future].handleEitherNonFatal(fa2)(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1176,7 +1177,7 @@ object fxSpec extends Properties { )( Fx[Future] .recoverEitherFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } ) @@ -1348,7 +1349,7 @@ object fxSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(Fx[Future].recoverEitherFromNonFatal(fa2) { case err => expected }) + )(Fx[Future].recoverEitherFromNonFatal(fa2) { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canCatchSpec.scala b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canCatchSpec.scala index 65b5dd1f..201606a1 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canCatchSpec.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canCatchSpec.scala @@ -1,12 +1,9 @@ package effectie.instances.tries -import cats._ -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ import effectie.testing.types._ -import extras.concurrent.testing.types.ErrorLogger import hedgehog._ import hedgehog.runner._ @@ -17,8 +14,6 @@ import scala.util.{Success, Try} */ object canCatchSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - override def tests: List[Test] = ioSpecs val ioSpecs = List( @@ -69,7 +64,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = FxCtor[F].effectOf(a) object TrySpec { diff --git a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canHandleErrorSpec.scala b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canHandleErrorSpec.scala index 82b5d994..6436f519 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canHandleErrorSpec.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canHandleErrorSpec.scala @@ -1,7 +1,5 @@ package effectie.instances.tries -import cats._ -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -117,7 +115,7 @@ object canHandleErrorSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = FxCtor[F].effectOf(a) object TrySpec { @@ -133,6 +131,9 @@ object canHandleErrorSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => FxCtor[Try].pureOf(expected) + + case err => + throw err } actual ==== Success(expected) @@ -286,6 +287,9 @@ object canHandleErrorSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + + case err => + throw err } actual ==== Success(expected) diff --git a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canRecoverSpec.scala b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canRecoverSpec.scala index 2c632573..a6e39c65 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canRecoverSpec.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/canRecoverSpec.scala @@ -1,7 +1,5 @@ package effectie.instances.tries -import cats._ -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -118,7 +116,7 @@ object canRecoverSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = FxCtor[F].effectOf(a) object TrySpec { diff --git a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/fxSpec.scala b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/fxSpec.scala index c0e754cb..1d7c4495 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/fxSpec.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/instances/tries/fxSpec.scala @@ -1,7 +1,7 @@ package effectie.instances.tries import cats.syntax.all._ -import cats.{Eq, Functor} +import cats.Eq import effectie.SomeControlThrowable import effectie.core._ import effectie.specs.MonadSpec @@ -251,7 +251,7 @@ object fxSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = Fx[F].effectOf(a) object TrySpec { @@ -404,6 +404,9 @@ object fxSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => Fx[Try].pureOf(expected) + + case err => + throw err } actual ==== Success(expected) @@ -561,6 +564,8 @@ object fxSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } actual ==== Success(expected) diff --git a/modules/effectie-core/shared/src/test/scala/effectie/specs/MonadSpec.scala b/modules/effectie-core/shared/src/test/scala/effectie/specs/MonadSpec.scala index eb8f54a4..b82420e6 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/specs/MonadSpec.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/specs/MonadSpec.scala @@ -6,6 +6,6 @@ import hedgehog.runner.Test object MonadSpec { type Fx[F[*]] = effectie.core.Fx[F] - def testMonadLaws[F[*]: Fx: Monad](name: String)(implicit eqF: Eq[F[Int]]): List[Test] = + def testMonadLaws[F[*]: Monad](name: String)(implicit eqF: Eq[F[Int]]): List[Test] = effectie.testing.cats.MonadSpec.testAllLaws[F](s"Fx[$name]") } diff --git a/modules/effectie-core/shared/src/test/scala/effectie/specs/fxCtorSpec/TrySpecs.scala b/modules/effectie-core/shared/src/test/scala/effectie/specs/fxCtorSpec/TrySpecs.scala index 90d99559..69fa0056 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/specs/fxCtorSpec/TrySpecs.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/specs/fxCtorSpec/TrySpecs.scala @@ -28,6 +28,7 @@ object TrySpecs { property("test FxCtor[Try].fromOption(None)", TrySpecs.testFromOptionNoneCase), property("test FxCtor[Try].fromTry(Success)", TrySpecs.testFromTrySuccessCase), property("test FxCtor[Try].fromTry(Failure)", TrySpecs.testFromTryFailureCase), + property("test FxCtor[Try].flatMapFa(Try[A])(A => Try[B])", TrySpecs.testFlatMapFx), ) private def testEffectOf(implicit tryFxCtor: FxCtor[Try]): Property = for { @@ -37,7 +38,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = (actual ==== before).log("before effectOf") - val fa = tryFxCtor.effectOf({ actual = after; () }) + val _ = tryFxCtor.effectOf({ actual = after; () }) val testAfterRun = (actual ==== after).log("after effectOf and run") Result.all( List( @@ -54,7 +55,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = (actual ==== before).log("before effectOf") - val afterFrom = tryFxCtor.fromEffect(tryFxCtor.effectOf({ actual = after; () })) + val _ = tryFxCtor.fromEffect(tryFxCtor.effectOf({ actual = after; () })) val testAfterRun = (actual ==== after).log("after fromEffect") Result.all( List( @@ -71,7 +72,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = (actual ==== before).log("before effectOf") - val afterFrom = tryFxCtor.fromEffect(tryFxCtor.pureOf({ actual = after; () })) + val _ = tryFxCtor.fromEffect(tryFxCtor.pureOf({ actual = after; () })) val testAfterRun = (actual ==== after).log("after fromEffect") Result.all( List( @@ -88,7 +89,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = (actual ==== before).log("before pureOrError") - val fa = tryFxCtor.pureOf({ actual = after; () }) + val _ = tryFxCtor.pureOf({ actual = after; () }) val testAfterRun = actual ==== after Result.all( List( @@ -105,7 +106,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = (actual ==== before).log("before pureOrError") - val fa = tryFxCtor.pureOrError({ actual = after; () }) + val _ = tryFxCtor.pureOrError({ actual = after; () }) val testAfterRun = (actual ==== after).log("after pureOrError and run") Result.all( List( diff --git a/modules/effectie-core/shared/src/test/scala/effectie/specs/fxSpec/TrySpecs.scala b/modules/effectie-core/shared/src/test/scala/effectie/specs/fxSpec/TrySpecs.scala index 80a55607..a88380c9 100644 --- a/modules/effectie-core/shared/src/test/scala/effectie/specs/fxSpec/TrySpecs.scala +++ b/modules/effectie-core/shared/src/test/scala/effectie/specs/fxSpec/TrySpecs.scala @@ -28,6 +28,7 @@ object TrySpecs { property("test Fx[Try].fromOption(None)", TrySpecs.testFromOptionNoneCase), property("test Fx[Try].fromTry(Success)", TrySpecs.testFromTrySuccessCase), property("test Fx[Try].fromTry(Failure)", TrySpecs.testFromTryFailureCase), + property("test Fx[Try].flatMapFa(Try[A])(A => Try[B])", TrySpecs.testFlatMapFx), ) private def testEffectOf(implicit tryFx: Fx[Try]): Property = for { @@ -37,7 +38,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = actual ==== before - val fa = tryFx.effectOf({ actual = after; () }) + val _ = tryFx.effectOf({ actual = after; () }) val testAfterRun = actual ==== after Result.all( List( @@ -54,7 +55,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = (actual ==== before).log("before effectOf") - val afterFrom = tryFx.fromEffect(tryFx.effectOf({ actual = after; () })) + val _ = tryFx.fromEffect(tryFx.effectOf({ actual = after; () })) val testAfterRun = (actual ==== after).log("after fromEffect") Result.all( List( @@ -71,7 +72,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = (actual ==== before).log("before effectOf") - val afterFrom = tryFx.fromEffect(tryFx.pureOf({ actual = after; () })) + val _ = tryFx.fromEffect(tryFx.pureOf({ actual = after; () })) val testAfterRun = (actual ==== after).log("after fromEffect") Result.all( List( @@ -88,7 +89,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = actual ==== before - val fa = tryFx.pureOf({ actual = after; () }) + val _ = tryFx.pureOf({ actual = after; () }) val testAfterRun = actual ==== after Result.all( List( @@ -105,7 +106,7 @@ object TrySpecs { var actual = before // scalafix:ok DisableSyntax.var val testBefore = actual ==== before - val fa = tryFx.pureOrError({ actual = after; () }) + val _ = tryFx.pureOrError({ actual = after; () }) val testAfterRun = actual ==== after Result.all( List( diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/CanRestartSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/CanRestartSpec.scala index 884f93a7..6842f77d 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/CanRestartSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/CanRestartSpec.scala @@ -137,6 +137,7 @@ object CanRestartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/MonadSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/MonadSpec.scala index e56b2cb0..d5115a70 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/MonadSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/MonadSpec.scala @@ -4,6 +4,6 @@ import cats.{Eq, Monad} import hedgehog.runner.Test object MonadSpec { - def testMonadLaws[F[*]: effectie.core.Fx: Monad](name: String)(implicit eqF: Eq[F[Int]]): List[Test] = + def testMonadLaws[F[*]: Monad](name: String)(implicit eqF: Eq[F[Int]]): List[Test] = effectie.testing.cats.MonadSpec.testAllLaws[F](s"Fx[$name]") } diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canCatchSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canCatchSpec.scala index 2f324102..0aac3066 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canCatchSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canCatchSpec.scala @@ -4,7 +4,6 @@ import canCatch._ import cats._ import cats.data.EitherT import cats.effect.IO -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -232,7 +231,7 @@ object canCatchSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object TaskSpec { diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canHandleErrorSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canHandleErrorSpec.scala index 52bad027..ea14b551 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canHandleErrorSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canHandleErrorSpec.scala @@ -4,7 +4,6 @@ import canHandleError._ import cats._ import cats.data.EitherT import cats.effect.IO -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -432,7 +431,7 @@ object canHandleErrorSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object TaskSpec { @@ -447,6 +446,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => Task.pure(expected) + case err => + throw err } .runSyncUnsafe() @@ -661,6 +662,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .runSyncUnsafe() @@ -879,6 +882,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => IO.pure(expected) + case err => + throw err } .unsafeRunSync() @@ -1093,6 +1098,8 @@ object canHandleErrorSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .unsafeRunSync() @@ -1421,7 +1428,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(err => Future(expected))) + )(CanHandleError[Future].handleEitherNonFatalWith(fa2)(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1485,7 +1492,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(err => Future(expected)).value) + )(CanHandleError[Future].handleEitherTNonFatalWith(fa2)(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1640,7 +1647,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherNonFatal(fa2)(err => expected)) + )(CanHandleError[Future].handleEitherNonFatal(fa2)(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1699,7 +1706,7 @@ object canHandleErrorSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanHandleError[Future].handleEitherTNonFatal(fa2)(err => expected).value) + )(CanHandleError[Future].handleEitherTNonFatal(fa2)(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canRecoverSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canRecoverSpec.scala index 51646a72..724d2d7f 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canRecoverSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/canRecoverSpec.scala @@ -4,7 +4,6 @@ import canRecover._ import cats._ import cats.data.EitherT import cats.effect.IO -import cats.instances.all._ import cats.syntax.all._ import effectie.SomeControlThrowable import effectie.core._ @@ -432,7 +431,7 @@ object canRecoverSpec extends Properties { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: FxCtor: Functor, A](a: => A): F[A] = + def run[F[*]: FxCtor, A](a: => A): F[A] = effectOf[F](a) object TaskSpec { @@ -1605,7 +1604,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } ) @@ -1683,7 +1682,7 @@ object canRecoverSpec extends Properties { )( CanRecover[Future] .recoverEitherTFromNonFatalWith(fa2) { - case err => Future(expected) + case err @ _ => Future(expected) } .value ) @@ -1858,7 +1857,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err => expected }) + )(CanRecover[Future].recoverEitherFromNonFatal(fa2) { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1926,7 +1925,7 @@ object canRecoverSpec extends Properties { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err => expected }.value) + )(CanRecover[Future].recoverEitherTFromNonFatal(fa2) { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxCtorSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxCtorSpec.scala index d67db3d0..3019828a 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxCtorSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxCtorSpec.scala @@ -1,10 +1,8 @@ package effectie.instances.monix3 -import effectie.core._ import fxCtor._ import effectie.specs.fxCtorSpec.FxCtorSpecs import effectie.testing.tools -import extras.concurrent.testing.types.ErrorLogger import hedgehog._ import hedgehog.runner._ import monix.eval.Task @@ -13,11 +11,10 @@ import monix.eval.Task * @since 2020-12-06 */ object fxCtorSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger override def tests: List[Test] = taskSpecs - def assertWithAttempt[F[*]: FxCtor]( + def assertWithAttempt[F[*]]( run: F[Int] => Either[Throwable, Int] ): (F[Int], Either[Throwable, Int]) => Result = { (io, expected) => val actual = run(io) diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxSpec.scala index 5eb770d6..e2ae368a 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/fxSpec.scala @@ -11,7 +11,6 @@ import effectie.specs.fxSpec.FxSpecs import effectie.syntax.error._ import effectie.testing.tools import effectie.testing.types.SomeError -import extras.concurrent.testing.types.ErrorLogger import hedgehog._ import hedgehog.runner._ import monix.eval.Task @@ -23,9 +22,7 @@ import scala.util.control.{ControlThrowable, NonFatal} */ object fxSpec extends Properties { - private implicit val errorLogger: ErrorLogger[Throwable] = ErrorLogger.printlnDefaultErrorLogger - - def assertWithAttempt[F[*]: Fx]( + def assertWithAttempt[F[*]]( run: F[Int] => Either[Throwable, Int] ): (F[Int], Either[Throwable, Int]) => Result = { (io, expected) => val actual = run(io) @@ -591,6 +588,8 @@ object fxSpec extends Properties { .handleNonFatalWith(fa) { case NonFatal(`expectedExpcetion`) => Task.pure(expected) + case err => + throw err } .runSyncUnsafe() @@ -805,6 +804,8 @@ object fxSpec extends Properties { .handleNonFatal(fa) { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .runSyncUnsafe() diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/toFutureSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/toFutureSpec.scala index 2e6a402e..438384b0 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/toFutureSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/instances/monix3/toFutureSpec.scala @@ -80,10 +80,6 @@ object toFutureSpec extends Properties { val fa = IO(expected) implicit val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - @SuppressWarnings(Array("org.wartremover.warts.ExplicitImplicitTypes")) - implicit val ec = - ConcurrentSupport.newExecutionContextWithLogger(es, ErrorLogger.printlnExecutionContextErrorLogger) - implicit val scheduler: Scheduler = Scheduler(ec) ConcurrentSupport.runAndShutdown(es, WaitFor(300.milliseconds)) { val future = ToFuture[IO].unsafeToFuture(fa) diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/errorSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/errorSpec.scala index b8feae52..6c58cabd 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/errorSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/errorSpec.scala @@ -258,7 +258,7 @@ object CanCatchSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object TaskSpec { @@ -1311,7 +1311,7 @@ object CanHandleErrorSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object TaskSpec { @@ -1327,6 +1327,8 @@ object CanHandleErrorSyntaxSpec { .handleNonFatalWith { case NonFatal(`expectedExpcetion`) => Task.pure(expected) + case err => + throw err } .runSyncUnsafe() @@ -1539,6 +1541,8 @@ object CanHandleErrorSyntaxSpec { .handleNonFatal { case NonFatal(`expectedExpcetion`) => expected + case err => + throw err } .runSyncUnsafe() @@ -1864,7 +1868,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatalWith(err => Future(expected))) + )(fa2.handleEitherNonFatalWith(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -1923,7 +1927,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherTNonFatalWith(err => Future(expected)).value) + )(fa2.handleEitherTNonFatalWith(_ => Future(expected)).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -2074,7 +2078,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatal(err => expected)) + )(fa2.handleEitherNonFatal(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -2133,7 +2137,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherTNonFatal(err => expected).value) + )(fa2.handleEitherTNonFatal(_ => expected).value) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -2916,7 +2920,7 @@ object CanRecoverSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object TaskSpec { @@ -3559,7 +3563,7 @@ object CanRecoverSyntaxSpec { executorService, waitFor, )(fa2.recoverEitherFromNonFatalWith { - case err => Future(expected) + case err @ _ => Future(expected) }) actualFailedResult ==== expectedFailedResult and actual ==== expected @@ -3626,7 +3630,7 @@ object CanRecoverSyntaxSpec { executorService, waitFor, )(fa2.recoverEitherTFromNonFatalWith { - case err => Future(expected) + case err @ _ => Future(expected) }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected @@ -3790,7 +3794,7 @@ object CanRecoverSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.recoverEitherFromNonFatal { case err => expected }) + )(fa2.recoverEitherFromNonFatal { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -3853,7 +3857,7 @@ object CanRecoverSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.recoverEitherTFromNonFatal { case err => expected }.value) + )(fa2.recoverEitherTFromNonFatal { case err @ _ => expected }.value) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/fxSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/fxSpec.scala index 9e169796..8b9c2bb5 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/fxSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/fxSpec.scala @@ -122,8 +122,8 @@ object fxSpec extends Properties { _ <- pureOf[Task]({ actual2 = after; () }) n <- eftClient.eftOf(1) n2 <- eftClient.of(n) - i <- effectConstructorClient.eftOf(1) - i2 <- effectConstructorClient.of(1) + i <- effectConstructorClient.eftOf(n2) + _ <- effectConstructorClient.of(i) _ <- eftClient.unit _ <- effectConstructorClient.unit } yield () @@ -319,8 +319,8 @@ object fxSpec extends Properties { _ <- pureOf[IO]({ actual2 = after; () }) n <- eftClient.eftOf(1) n2 <- eftClient.of(n) - i <- effectConstructorClient.eftOf(1) - i2 <- effectConstructorClient.of(1) + i <- effectConstructorClient.eftOf(n2) + _ <- effectConstructorClient.of(i) _ <- eftClient.unit _ <- effectConstructorClient.unit } yield () @@ -525,8 +525,8 @@ object fxSpec extends Properties { _ <- pureOf[Future]({ actual2 = after; () }) n <- eftClient.eftOf(1) n2 <- eftClient.of(n) - i <- effectConstructorClient.eftOf(1) - i2 <- effectConstructorClient.of(1) + i <- effectConstructorClient.eftOf(n2) + _ <- effectConstructorClient.of(i) _ <- eftClient.unit _ <- effectConstructorClient.unit } yield () diff --git a/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/restartSpec.scala b/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/restartSpec.scala index 13d1b712..e5e9295e 100644 --- a/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/restartSpec.scala +++ b/modules/effectie-monix3/shared/src/test/scala/effectie/syntax/restartSpec.scala @@ -138,6 +138,7 @@ object restartSpec extends Properties { { case KeepGoing => true case End => false + case err => throw err }, ) .handleErrorWith { diff --git a/modules/effectie-syntax/shared/src/test/scala-2/effectie/syntax/errorSpec.scala b/modules/effectie-syntax/shared/src/test/scala-2/effectie/syntax/errorSpec.scala index d96fbcd1..3cb92bf2 100644 --- a/modules/effectie-syntax/shared/src/test/scala-2/effectie/syntax/errorSpec.scala +++ b/modules/effectie-syntax/shared/src/test/scala-2/effectie/syntax/errorSpec.scala @@ -1,6 +1,5 @@ package effectie.syntax -import cats._ import cats.data.EitherT import cats.syntax.all._ import effectie.core.Fx @@ -60,7 +59,7 @@ object CanCatchSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object FutureSpec { @@ -284,7 +283,7 @@ object CanHandleErrorSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object FutureSpec { @@ -409,7 +408,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatalWith(err => Future(expected))) + )(fa2.handleEitherNonFatalWith(_ => Future(expected))) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -560,7 +559,7 @@ object CanHandleErrorSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.handleEitherNonFatal(err => expected)) + )(fa2.handleEitherNonFatal(_ => expected)) actualFailedResult ==== expectedFailedResult and actual ==== expected } @@ -753,7 +752,7 @@ object CanRecoverSyntaxSpec { def throwThrowable[A](throwable: => Throwable): A = throw throwable // scalafix:ok DisableSyntax.throw - def run[F[*]: Fx: Functor, A](a: => A): F[A] = + def run[F[*]: Fx, A](a: => A): F[A] = effectOf[F](a) object FutureSpec { @@ -896,7 +895,7 @@ object CanRecoverSyntaxSpec { executorService, waitFor, )(fa2.recoverEitherFromNonFatalWith { - case err => Future(expected) + case err @ _ => Future(expected) }) actualFailedResult ==== expectedFailedResult and actual ==== expected @@ -1063,7 +1062,7 @@ object CanRecoverSyntaxSpec { ConcurrentSupport.futureToValueAndTerminate( executorService, waitFor, - )(fa2.recoverEitherFromNonFatal { case err => expected }) + )(fa2.recoverEitherFromNonFatal { case err @ _ => expected }) actualFailedResult ==== expectedFailedResult and actual ==== expected } diff --git a/modules/effectie-test4cats/shared/src/main/scala/effectie/testing/cats/Laws.scala b/modules/effectie-test4cats/shared/src/main/scala/effectie/testing/cats/Laws.scala index f4dc7487..2f735ac4 100644 --- a/modules/effectie-test4cats/shared/src/main/scala/effectie/testing/cats/Laws.scala +++ b/modules/effectie-test4cats/shared/src/main/scala/effectie/testing/cats/Laws.scala @@ -22,7 +22,7 @@ object Laws { /* Functors preserve composition of morphisms * fmap (f . g) == fmap f . fmap g */ - def composition[F[*]: Functor, A, B, C](fa: F[A], f: B => C, g: A => B)( + def composition[F[*], A, B, C](fa: F[A], f: B => C, g: A => B)( implicit F: Functor[F], FC: Eq[F[C]], ): Boolean = @@ -37,25 +37,25 @@ object Laws { /* Identity * pure id <*> v = v */ - def identityAp[F[*]: Applicative, A](fa: => F[A])( - implicit F: Functor[F], + def identityAp[F[*], A](fa: => F[A])( + implicit F: Applicative[F], FA: Eq[F[A]], ): Boolean = FA.eqv( - Applicative[F].ap[A, A](Applicative[F].pure(scala.Predef.identity))(fa), + F.ap[A, A](F.pure(scala.Predef.identity))(fa), fa, ) /* Homomorphism * pure f <*> pure x = pure (f x) */ - def homomorphism[F[*]: Applicative, A, B](f: A => B, a: => A)( - implicit F: Functor[F], + def homomorphism[F[*], A, B](f: A => B, a: => A)( + implicit F: Applicative[F], FB: Eq[F[B]], ): Boolean = FB.eqv( - Applicative[F].ap(Applicative[F].pure(f))(Applicative[F].pure(a)), - Applicative[F].pure(f(a)), + F.ap(F.pure(f))(F.pure(a)), + F.pure(f(a)), ) /* Interchange diff --git a/project/build.properties b/project/build.properties index 27430827..e8a1e246 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.6 +sbt.version=1.9.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index d18ec386..7424ac58 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,12 +8,12 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.2") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2") -addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.13.0") +addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.15.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") -val sbtDevOopsVersion = "2.24.0" +val sbtDevOopsVersion = "3.0.0" addSbtPlugin("io.kevinlee" % "sbt-devoops-scala" % sbtDevOopsVersion) addSbtPlugin("io.kevinlee" % "sbt-devoops-sbt-extra" % sbtDevOopsVersion) addSbtPlugin("io.kevinlee" % "sbt-devoops-github" % sbtDevOopsVersion)