From 9b5289daa5f0d667916c44a69c417230b4dfdbb1 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 25 Jun 2021 10:21:17 +0200 Subject: [PATCH 1/3] Organize imports in transformer tests --- tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala | 5 ++--- tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala | 5 ++--- tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala | 5 ++--- tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala | 5 ++--- tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala | 5 ++--- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala index 9e1233637f..b35d982143 100644 --- a/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala @@ -16,11 +16,10 @@ package cats.effect -import cats.data.EitherT import cats.Order -import cats.laws.discipline.arbitrary._ +import cats.data.EitherT import cats.effect.laws.AsyncTests -import cats.implicits._ +import cats.laws.discipline.arbitrary._ import org.scalacheck.Prop diff --git a/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala index 80e48466e0..e3de5d5bf1 100644 --- a/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala @@ -16,11 +16,10 @@ package cats.effect -import cats.data.{Ior, IorT} import cats.Order -import cats.laws.discipline.arbitrary._ +import cats.data.{Ior, IorT} import cats.effect.laws.AsyncTests -import cats.implicits._ +import cats.laws.discipline.arbitrary._ import org.scalacheck.Prop diff --git a/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala b/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala index 1b7090427d..927a1559c4 100644 --- a/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala @@ -16,13 +16,12 @@ package cats.effect -import cats.data.Kleisli import cats.{Eq, Order} +import cats.data.Kleisli +import cats.effect.laws.AsyncTests import cats.laws.discipline.MiniInt import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ -import cats.effect.laws.AsyncTests -import cats.implicits._ import org.scalacheck.Prop diff --git a/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala index b96f828415..2d686128c4 100644 --- a/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala @@ -16,11 +16,10 @@ package cats.effect -import cats.data.OptionT import cats.Order -import cats.laws.discipline.arbitrary._ +import cats.data.OptionT import cats.effect.laws.AsyncTests -import cats.implicits._ +import cats.laws.discipline.arbitrary._ import org.scalacheck.Prop // import org.scalacheck.rng.Seed diff --git a/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala index b834a82e3d..623e01fef5 100644 --- a/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala @@ -16,11 +16,10 @@ package cats.effect -import cats.data.WriterT import cats.Order -import cats.laws.discipline.arbitrary._ +import cats.data.WriterT import cats.effect.laws.AsyncTests -import cats.implicits._ +import cats.laws.discipline.arbitrary._ import org.scalacheck.Prop From fa23b751cc9e0dda1c3735e1a3d6e3725c7e1a09 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 25 Jun 2021 10:22:58 +0200 Subject: [PATCH 2/3] Remove custom Order for Ior and IorT --- .../test/scala/cats/effect/IorTIOSpec.scala | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala index e3de5d5bf1..723c2b6d82 100644 --- a/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala @@ -17,7 +17,7 @@ package cats.effect import cats.Order -import cats.data.{Ior, IorT} +import cats.data.IorT import cats.effect.laws.AsyncTests import cats.laws.discipline.arbitrary._ @@ -38,30 +38,6 @@ class IorTIOSpec extends IOPlatformSpecification with Discipline with ScalaCheck implicit def ordIorTIOFD(implicit ticker: Ticker): Order[IorT[IO, Int, FiniteDuration]] = Order by { ioaO => unsafeRun(ioaO.value).fold(None, _ => None, fa => fa) } - //TODO remove once https://github.com/typelevel/cats/pull/3555 is released - implicit def orderIor[A, B]( - implicit A: Order[A], - B: Order[B], - AB: Order[(A, B)]): Order[Ior[A, B]] = - new Order[Ior[A, B]] { - - override def compare(x: Ior[A, B], y: Ior[A, B]): Int = - (x, y) match { - case (Ior.Left(a1), Ior.Left(a2)) => A.compare(a1, a2) - case (Ior.Left(_), _) => -1 - case (Ior.Both(a1, b1), Ior.Both(a2, b2)) => AB.compare((a1, b1), (a2, b2)) - case (Ior.Both(_, _), Ior.Left(_)) => 1 - case (Ior.Both(_, _), Ior.Right(_)) => -1 - case (Ior.Right(b1), Ior.Right(b2)) => B.compare(b1, b2) - case (Ior.Right(_), _) => 1 - } - - } - - //TODO remove once https://github.com/typelevel/cats/pull/3555 is released - implicit def orderIorT[F[_], A, B](implicit Ord: Order[F[Ior[A, B]]]): Order[IorT[F, A, B]] = - Order.by(_.value) - implicit def execIorT(sbool: IorT[IO, Int, Boolean])(implicit ticker: Ticker): Prop = Prop( unsafeRun(sbool.value).fold( From 35ca43c8db00ec997739be1259b1586b78c15355 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Fri, 25 Jun 2021 10:25:17 +0200 Subject: [PATCH 3/3] Remove custom Order for WriterT --- tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala index 623e01fef5..9b3dbebbe9 100644 --- a/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala @@ -43,11 +43,6 @@ class WriterTIOSpec implicit ticker: Ticker): Order[WriterT[IO, Int, FiniteDuration]] = Order by { ioaO => unsafeRun(ioaO.run).fold(None, _ => None, fa => fa) } - //TODO remove once https://github.com/typelevel/cats/pull/3556 is released - implicit def orderWriterT[F[_], S, A]( - implicit Ord: Order[F[(S, A)]]): Order[WriterT[F, S, A]] = Order.by(_.run) - - //TODO remove once https://github.com/typelevel/cats/pull/3556 is released implicit def execWriterT[S](sbool: WriterT[IO, S, Boolean])(implicit ticker: Ticker): Prop = Prop( unsafeRun(sbool.run).fold(