diff --git a/alleycats-tests/js/src/test/scala/alleycats/tests/TestSettings.scala b/alleycats-tests/js/src/test/scala/alleycats/tests/TestSettings.scala index 8825db0afb..a467b9bbd8 100644 --- a/alleycats-tests/js/src/test/scala/alleycats/tests/TestSettings.scala +++ b/alleycats-tests/js/src/test/scala/alleycats/tests/TestSettings.scala @@ -1,5 +1,4 @@ -package alleycats -package tests +package alleycats.tests import org.scalactic.anyvals.{PosInt, PosZDouble, PosZInt} import org.scalatest.matchers.should.Matchers diff --git a/alleycats-tests/jvm/src/test/scala/alleycats/tests/TestSettings.scala b/alleycats-tests/jvm/src/test/scala/alleycats/tests/TestSettings.scala index 027e25ec8d..69f25493b0 100644 --- a/alleycats-tests/jvm/src/test/scala/alleycats/tests/TestSettings.scala +++ b/alleycats-tests/jvm/src/test/scala/alleycats/tests/TestSettings.scala @@ -1,5 +1,4 @@ -package alleycats -package tests +package alleycats.tests import org.scalactic.anyvals.{PosInt, PosZDouble, PosZInt} import org.scalatest.matchers.should.Matchers diff --git a/alleycats-tests/shared/src/test/scala/alleycats/tests/AlleycatsSuite.scala b/alleycats-tests/shared/src/test/scala/alleycats/tests/AlleycatsSuite.scala index f80cadfb85..09e9f72a94 100644 --- a/alleycats-tests/shared/src/test/scala/alleycats/tests/AlleycatsSuite.scala +++ b/alleycats-tests/shared/src/test/scala/alleycats/tests/AlleycatsSuite.scala @@ -1,10 +1,8 @@ -package alleycats -package tests +package alleycats.tests import alleycats.std.MapInstances import cats._ -import cats.instances.AllInstances -import cats.syntax.{AllSyntax, EqOps} +import cats.instances.all._ import cats.tests.StrictCatsEquality import org.scalatest.funsuite.AnyFunSuiteLike import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks @@ -12,7 +10,6 @@ import org.typelevel.discipline.scalatest.FunSuiteDiscipline import org.scalacheck.{Arbitrary, Gen} import org.scalacheck.Arbitrary.arbitrary import org.scalatest.matchers.should.Matchers - import scala.util.{Failure, Success, Try} /** @@ -25,18 +22,12 @@ trait AlleycatsSuite with ScalaCheckDrivenPropertyChecks with FunSuiteDiscipline with TestSettings - with AllInstances - with AllSyntax with TestInstances with StrictCatsEquality with MapInstances { implicit override val generatorDrivenConfig: PropertyCheckConfiguration = checkConfiguration - // disable Eq syntax (by making `catsSyntaxEq` not implicit), since it collides - // with scalactic's equality - override def catsSyntaxEq[A: Eq](a: A): EqOps[A] = new EqOps[A](a) - implicit def EqIterable[A: Eq]: Eq[Iterable[A]] = Eq.by(_.toList) } diff --git a/alleycats-tests/shared/src/test/scala/alleycats/tests/IterableTests.scala b/alleycats-tests/shared/src/test/scala/alleycats/tests/IterableTests.scala index d85b8d4548..7dc04085d9 100644 --- a/alleycats-tests/shared/src/test/scala/alleycats/tests/IterableTests.scala +++ b/alleycats-tests/shared/src/test/scala/alleycats/tests/IterableTests.scala @@ -1,8 +1,8 @@ -package alleycats -package tests +package alleycats.tests -import cats.{Eval, Foldable} import alleycats.std.all._ +import cats.{Eval, Foldable} +import cats.instances.all._ import cats.laws.discipline.FoldableTests class IterableTests extends AlleycatsSuite { diff --git a/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala b/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala index a7a31b9c05..8b3bb7ce50 100644 --- a/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala +++ b/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala @@ -1,8 +1,9 @@ package alleycats.tests -import cats.laws.discipline.arbitrary._ -import cats.laws.discipline.{SerializableTests, TraverseFilterTests} import cats.Traverse +import cats.instances.all._ +import cats.laws.discipline.{SerializableTests, TraverseFilterTests} +import cats.laws.discipline.arbitrary._ class MapSuite extends AlleycatsSuite { checkAll("Traverse[Map[Int, *]]", SerializableTests.serializable(Traverse[Map[Int, *]])) diff --git a/alleycats-tests/shared/src/test/scala/alleycats/tests/SetSuite.scala b/alleycats-tests/shared/src/test/scala/alleycats/tests/SetSuite.scala index f9872c5ae4..da12066ac5 100644 --- a/alleycats-tests/shared/src/test/scala/alleycats/tests/SetSuite.scala +++ b/alleycats-tests/shared/src/test/scala/alleycats/tests/SetSuite.scala @@ -1,12 +1,12 @@ package alleycats.tests import alleycats.laws.discipline._ +import alleycats.std.all._ import cats.Foldable +import cats.instances.all._ import cats.kernel.laws.discipline.SerializableTests -import cats.laws.discipline.arbitrary._ import cats.laws.discipline.TraverseFilterTests - -import alleycats.std.all._ +import cats.laws.discipline.arbitrary._ class SetSuite extends AlleycatsSuite { checkAll("FlatMapRec[Set]", FlatMapRecTests[Set].tailRecM[Int]) diff --git a/free/src/test/scala/cats/free/CofreeSuite.scala b/free/src/test/scala/cats/free/CofreeSuite.scala index 09d4c8c622..512c6ffc88 100644 --- a/free/src/test/scala/cats/free/CofreeSuite.scala +++ b/free/src/test/scala/cats/free/CofreeSuite.scala @@ -1,7 +1,9 @@ -package cats -package free +package cats.free +import cats.{~>, Comonad, Eval, Id, Reducible, Traverse} import cats.data.{NonEmptyList, OptionT} +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline.{ComonadTests, ReducibleTests, SerializableTests, TraverseTests} import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.syntax.list._ diff --git a/free/src/test/scala/cats/free/ContravariantCoyonedaSuite.scala b/free/src/test/scala/cats/free/ContravariantCoyonedaSuite.scala index 469f7702c9..c6b96258ab 100644 --- a/free/src/test/scala/cats/free/ContravariantCoyonedaSuite.scala +++ b/free/src/test/scala/cats/free/ContravariantCoyonedaSuite.scala @@ -1,10 +1,11 @@ -package cats -package free +package cats.free +import cats.{~>, Contravariant} import cats.arrow.FunctionK -import cats.tests.CatsSuite +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline.{ContravariantTests, SerializableTests} - +import cats.tests.CatsSuite import org.scalacheck.{Arbitrary} class ContravariantCoyonedaSuite extends CatsSuite { diff --git a/free/src/test/scala/cats/free/CoyonedaSuite.scala b/free/src/test/scala/cats/free/CoyonedaSuite.scala index f9580b6c2b..30004ea51c 100644 --- a/free/src/test/scala/cats/free/CoyonedaSuite.scala +++ b/free/src/test/scala/cats/free/CoyonedaSuite.scala @@ -1,10 +1,11 @@ -package cats -package free +package cats.free -import cats.tests.CatsSuite +import cats.Functor import cats.arrow.FunctionK +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline.{FunctorTests, SerializableTests} - +import cats.tests.CatsSuite import org.scalacheck.Arbitrary class CoyonedaSuite extends CatsSuite { diff --git a/free/src/test/scala/cats/free/FreeApplicativeSuite.scala b/free/src/test/scala/cats/free/FreeApplicativeSuite.scala index 01e7f8e386..b758a55dff 100644 --- a/free/src/test/scala/cats/free/FreeApplicativeSuite.scala +++ b/free/src/test/scala/cats/free/FreeApplicativeSuite.scala @@ -1,12 +1,14 @@ -package cats -package free +package cats.free -import cats.tests.CatsSuite +import cats.{~>, Applicative, Apply, Id} import cats.arrow.FunctionK +import cats.data.State +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline.{ApplicativeTests, SerializableTests} import cats.laws.discipline.SemigroupalTests.Isomorphisms -import cats.data.State - +import cats.syntax.apply._ +import cats.tests.CatsSuite import org.scalacheck.{Arbitrary, Gen} class FreeApplicativeSuite extends CatsSuite { diff --git a/free/src/test/scala/cats/free/FreeInvariantMonoidalSuite.scala b/free/src/test/scala/cats/free/FreeInvariantMonoidalSuite.scala index dc39795101..95d8e6bffe 100644 --- a/free/src/test/scala/cats/free/FreeInvariantMonoidalSuite.scala +++ b/free/src/test/scala/cats/free/FreeInvariantMonoidalSuite.scala @@ -1,13 +1,17 @@ -package cats -package tests +package cats.free +import cats.{Id, InvariantMonoidal} import cats.arrow.FunctionK -import cats.free.FreeInvariantMonoidal +import cats.kernel.Eq +import cats.instances.all._ import cats.laws.discipline.{InvariantMonoidalTests, MiniInt, SerializableTests} import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms -import org.scalacheck.{Arbitrary, Gen} +import cats.syntax.invariant._ +import cats.syntax.semigroupal._ import cats.tests.BinCodecInvariantMonoidalSuite._ +import cats.tests.CatsSuite +import org.scalacheck.{Arbitrary, Gen} class FreeInvariantMonoidalSuite extends CatsSuite { implicit def freeInvariantMonoidalArbitrary[F[_], A](implicit F: Arbitrary[F[A]], diff --git a/free/src/test/scala/cats/free/FreeSuite.scala b/free/src/test/scala/cats/free/FreeSuite.scala index 1d75abb73f..c63ea0f219 100644 --- a/free/src/test/scala/cats/free/FreeSuite.scala +++ b/free/src/test/scala/cats/free/FreeSuite.scala @@ -1,15 +1,17 @@ -package cats -package free +package cats.free +import cats.{:<:, Foldable, Functor, Id, Monad, Traverse} import cats.arrow.FunctionK import cats.data.EitherK +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline.{DeferTests, FoldableTests, MonadTests, SerializableTests, TraverseTests} import cats.laws.discipline.arbitrary.catsLawsArbitraryForFn0 import cats.laws.discipline.SemigroupalTests.Isomorphisms +import cats.syntax.apply._ import cats.tests.CatsSuite - import org.scalacheck.{Arbitrary, Cogen, Gen} -import Arbitrary.arbFunction1 +import org.scalacheck.Arbitrary.arbFunction1 class FreeSuite extends CatsSuite { import FreeSuite._ diff --git a/free/src/test/scala/cats/free/FreeTSuite.scala b/free/src/test/scala/cats/free/FreeTSuite.scala index 2210a23816..f5a2591a7a 100644 --- a/free/src/test/scala/cats/free/FreeTSuite.scala +++ b/free/src/test/scala/cats/free/FreeTSuite.scala @@ -1,12 +1,13 @@ -package cats -package free +package cats.free import cats._ import cats.arrow.FunctionK import cats.data._ +import cats.instances.all._ import cats.laws.discipline._ +import cats.syntax.applicative._ +import cats.syntax.either._ import cats.tests.CatsSuite -import cats.instances.option._ import org.scalacheck.{Arbitrary, Cogen, Gen} class FreeTSuite extends CatsSuite { diff --git a/free/src/test/scala/cats/free/YonedaSuite.scala b/free/src/test/scala/cats/free/YonedaSuite.scala index aec0d13adf..75eecc049d 100644 --- a/free/src/test/scala/cats/free/YonedaSuite.scala +++ b/free/src/test/scala/cats/free/YonedaSuite.scala @@ -1,9 +1,10 @@ -package cats -package free +package cats.free -import cats.tests.CatsSuite +import cats.Functor +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline.{FunctorTests, SerializableTests} - +import cats.tests.CatsSuite import org.scalacheck.Arbitrary class YonedaSuite extends CatsSuite { diff --git a/js/src/test/scala/cats/tests/FutureTests.scala b/js/src/test/scala/cats/tests/FutureTests.scala index d19a45528f..35477b01d6 100644 --- a/js/src/test/scala/cats/tests/FutureTests.scala +++ b/js/src/test/scala/cats/tests/FutureTests.scala @@ -1,19 +1,19 @@ -package cats -package js -package tests +package cats.js.tests -import cats.kernel.laws.discipline.{MonoidTests => MonoidLawTests, SemigroupTests => SemigroupLawTests} -import cats.laws.discipline._ +import cats.Comonad +import cats.instances.all._ import cats.js.instances.Await import cats.js.instances.future.futureComonad +import cats.kernel.Eq +import cats.kernel.laws.discipline.{MonoidTests => MonoidLawTests, SemigroupTests => SemigroupLawTests} +import cats.laws.discipline._ +import cats.laws.discipline.arbitrary._ +import cats.syntax.either._ import cats.tests.{CatsSuite, ListWrapper} - -import scala.concurrent.{ExecutionContextExecutor, Future} -import scala.concurrent.duration._ - import org.scalacheck.{Arbitrary, Cogen} import org.scalacheck.Arbitrary.arbitrary -import cats.laws.discipline.arbitrary._ +import scala.concurrent.{ExecutionContextExecutor, Future} +import scala.concurrent.duration._ class FutureTests extends CatsSuite { // Replaces Scala.js's `JSExecutionContext.runNow`, which is removed in 1.0. @@ -46,7 +46,7 @@ class FutureTests extends CatsSuite { implicit val throwableEq: Eq[Throwable] = Eq.by[Throwable, String](_.toString) - implicit val comonad: Comonad[Future] = futureComonad(timeout) + val comonad: Comonad[Future] = futureComonad(timeout) // Need non-fatal Throwables for Future recoverWith/handleError implicit val nonFatalArbitrary: Arbitrary[Throwable] = @@ -59,7 +59,7 @@ class FutureTests extends CatsSuite { Cogen[Unit].contramap(_ => ()) checkAll("Future[Int]", MonadErrorTests[Future, Throwable].monadError[Int, Int, Int]) - checkAll("Future[Int]", ComonadTests[Future].comonad[Int, Int, Int]) + checkAll("Future[Int]", ComonadTests[Future](comonad).comonad[Int, Int, Int]) checkAll("Future", MonadTests[Future].monad[Int, Int, Int]) { diff --git a/jvm/src/test/scala/cats/tests/FutureSuite.scala b/jvm/src/test/scala/cats/tests/FutureSuite.scala index 57023d3c76..48a1580df0 100644 --- a/jvm/src/test/scala/cats/tests/FutureSuite.scala +++ b/jvm/src/test/scala/cats/tests/FutureSuite.scala @@ -1,18 +1,18 @@ -package cats -package jvm -package tests +package cats.jvm.tests +import cats.instances.all._ +import cats.kernel.{Eq, Semigroup} import cats.kernel.laws.discipline.{MonoidTests => MonoidLawTests, SemigroupTests => SemigroupLawTests} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ +import cats.syntax.either._ import cats.tests.{CatsSuite, ListWrapper} - -import scala.concurrent.{Await, Future} -import scala.concurrent.duration._ -import scala.concurrent.ExecutionContext.Implicits.global import org.scalacheck.{Arbitrary, Cogen} import org.scalacheck.Arbitrary.arbitrary import org.scalacheck.rng.Seed +import scala.concurrent.{Await, Future} +import scala.concurrent.duration._ +import scala.concurrent.ExecutionContext.Implicits.global class FutureSuite extends CatsSuite { val timeout = 3.seconds diff --git a/testkit/src/main/scala/cats/tests/Helpers.scala b/testkit/src/main/scala/cats/tests/Helpers.scala index fc1607eb4c..5ad1be59c3 100644 --- a/testkit/src/main/scala/cats/tests/Helpers.scala +++ b/testkit/src/main/scala/cats/tests/Helpers.scala @@ -1,11 +1,8 @@ -package cats -package tests +package cats.tests +import cats.kernel._ import org.scalacheck.{Arbitrary, Cogen} -import Arbitrary.arbitrary - -import cats.kernel.{CommutativeGroup, CommutativeMonoid, CommutativeSemigroup} -import cats.kernel.{Band, BoundedSemilattice, Semilattice} +import org.scalacheck.Arbitrary.arbitrary /** * Helpers provides new concrete types where we control exactly which diff --git a/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala b/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala index 1f409c3c2e..76c3d52481 100644 --- a/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala +++ b/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala @@ -1,12 +1,16 @@ -package cats -package tests +package cats.tests +import cats.{Comonad, Eval, Functor, Monad, NonEmptyTraverse, Now, Reducible, SemigroupK, Show} import cats.data.{NonEmptyStream, OneAnd} -import cats.instances.stream._ +import cats.instances.all._ +import cats.kernel.Semigroup import cats.kernel.laws.discipline.{EqTests, SemigroupTests} -import cats.laws.discipline.arbitrary._ -import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline._ +import cats.laws.discipline.SemigroupalTests.Isomorphisms +import cats.laws.discipline.arbitrary._ +import cats.syntax.foldable._ +import cats.syntax.reducible._ +import cats.syntax.show._ class NonEmptyStreamSuite extends CatsSuite { // Lots of collections here.. telling ScalaCheck to calm down a bit diff --git a/tests/src/test/scala-2.12/cats/tests/ScalaVersionSpecific.scala b/tests/src/test/scala-2.12/cats/tests/ScalaVersionSpecific.scala index ee36a85cbe..e3b8ed2a75 100644 --- a/tests/src/test/scala-2.12/cats/tests/ScalaVersionSpecific.scala +++ b/tests/src/test/scala-2.12/cats/tests/ScalaVersionSpecific.scala @@ -1,5 +1,4 @@ -package cats -package tests +package cats.tests trait ScalaVersionSpecificFoldableSuite trait ScalaVersionSpecificParallelSuite diff --git a/tests/src/test/scala-2.13+/cats/tests/ArraySeqSuite.scala b/tests/src/test/scala-2.13+/cats/tests/ArraySeqSuite.scala index fa1a291990..80849c51e9 100644 --- a/tests/src/test/scala-2.13+/cats/tests/ArraySeqSuite.scala +++ b/tests/src/test/scala-2.13+/cats/tests/ArraySeqSuite.scala @@ -1,6 +1,8 @@ -package cats -package tests +package cats.tests +import cats.{Align, Alternative, CoflatMap, Monad, MonoidK, Traverse, TraverseFilter} +import cats.instances.all._ +import cats.kernel.{Eq, Hash, Monoid, Order, PartialOrder} import cats.kernel.laws.discipline.{EqTests, HashTests, MonoidTests, OrderTests, PartialOrderTests} import cats.laws.discipline.{ AlignTests, @@ -12,7 +14,7 @@ import cats.laws.discipline.{ TraverseTests } import cats.laws.discipline.arbitrary._ - +import cats.syntax.show._ import scala.collection.immutable.ArraySeq class ArraySeqSuite extends CatsSuite { diff --git a/tests/src/test/scala-2.13+/cats/tests/LazyListSuite.scala b/tests/src/test/scala-2.13+/cats/tests/LazyListSuite.scala index 0dc05aaa1a..3674f291fe 100644 --- a/tests/src/test/scala-2.13+/cats/tests/LazyListSuite.scala +++ b/tests/src/test/scala-2.13+/cats/tests/LazyListSuite.scala @@ -1,6 +1,8 @@ -package cats -package tests +package cats.tests +import cats.{Align, Alternative, CoflatMap, Monad, Semigroupal, Traverse, TraverseFilter} +import cats.data.ZipLazyList +import cats.instances.all._ import cats.laws.discipline.{ AlignTests, AlternativeTests, @@ -12,8 +14,8 @@ import cats.laws.discipline.{ TraverseFilterTests, TraverseTests } -import cats.data.ZipLazyList import cats.laws.discipline.arbitrary._ +import cats.syntax.show._ import org.scalatest.funsuite.AnyFunSuiteLike class LazyListSuite extends CatsSuite { diff --git a/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala b/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala index 48ba017f4f..c4751f0d93 100644 --- a/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala +++ b/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala @@ -1,10 +1,14 @@ -package cats -package tests +package cats.tests +import cats.{Align, Bimonad, SemigroupK, Show, Traverse} import cats.data.{NonEmptyLazyList, NonEmptyLazyListOps} +import cats.instances.all._ +import cats.kernel.{Eq, Hash, Order, PartialOrder, Semigroup} import cats.kernel.laws.discipline.{EqTests, HashTests, OrderTests, PartialOrderTests, SemigroupTests} import cats.laws.discipline.{AlignTests, BimonadTests, NonEmptyTraverseTests, SemigroupKTests, SerializableTests} import cats.laws.discipline.arbitrary._ +import cats.syntax.either._ +import cats.syntax.foldable._ class NonEmptyLazyListSuite extends NonEmptyCollectionSuite[LazyList, NonEmptyLazyList, NonEmptyLazyListOps] { protected def toList[A](value: NonEmptyLazyList[A]): List[A] = value.toList diff --git a/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala b/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala index 3eea504b0a..ff44c4ca5b 100644 --- a/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala +++ b/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala @@ -1,10 +1,14 @@ -package cats -package tests +package cats.tests +import cats.{Eval, Foldable, Id, Now} import cats.data.NonEmptyLazyList -import cats.instances.lazyList._ +import cats.instances.all._ import cats.laws.discipline.{NonEmptyParallelTests, ParallelTests} import cats.laws.discipline.arbitrary._ +import cats.syntax.either._ +import cats.syntax.foldable._ +import cats.syntax.parallel._ +import cats.syntax.traverse._ trait ScalaVersionSpecificFoldableSuite { self: FoldableSuiteAdditional => test("Foldable[LazyList].foldM stack safety") { diff --git a/tests/src/test/scala/cats/tests/AlgebraInvariantSuite.scala b/tests/src/test/scala/cats/tests/AlgebraInvariantSuite.scala index c62233ed22..73962c6146 100644 --- a/tests/src/test/scala/cats/tests/AlgebraInvariantSuite.scala +++ b/tests/src/test/scala/cats/tests/AlgebraInvariantSuite.scala @@ -1,7 +1,7 @@ -package cats -package tests +package cats.tests -import cats.Invariant +import cats.{CommutativeApplicative, CommutativeApply, Invariant, InvariantMonoidal} +import cats.instances._ import cats.kernel._ import cats.kernel.laws.discipline.{SemigroupTests, MonoidTests, GroupTests, _} import cats.laws.discipline.{ @@ -11,16 +11,29 @@ import cats.laws.discipline.{ MiniInt, SerializableTests } -import MiniInt._ +import cats.laws.discipline.MiniInt._ import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ +import cats.syntax.invariant._ +import cats.syntax.order._ import org.scalacheck.{Arbitrary, Gen} -class AlgebraInvariantSuite extends CatsSuite { +class AlgebraInvariantSuite + extends CatsSuite + with AllInstances + with AllInstancesBinCompat0 + with AllInstancesBinCompat1 + with AllInstancesBinCompat2 + with AllInstancesBinCompat3 + with AllInstancesBinCompat4 + with AllInstancesBinCompat5 + with AllInstancesBinCompat6 { // working around https://github.com/typelevel/cats/issues/2701 implicit private val eqSetBooleanTuple: Eq[(Set[Boolean], Set[Boolean])] = Eq.fromUniversalEquals implicit private val eqSetBooleanBooleanTuple: Eq[(Set[Boolean], Boolean)] = Eq.fromUniversalEquals + catsLawsEqForBand[Set[Boolean]] + // https://github.com/typelevel/cats/issues/2725 implicit private def commutativeMonoidForSemigroup[A]( implicit csA: CommutativeSemigroup[A] diff --git a/tests/src/test/scala/cats/tests/AlignSuite.scala b/tests/src/test/scala/cats/tests/AlignSuite.scala index 167bc0e760..c769380a26 100644 --- a/tests/src/test/scala/cats/tests/AlignSuite.scala +++ b/tests/src/test/scala/cats/tests/AlignSuite.scala @@ -1,6 +1,7 @@ package cats.tests import cats.Align +import cats.instances.all._ import cats.kernel.laws.discipline.SemigroupTests class AlignSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/AlternativeSuite.scala b/tests/src/test/scala/cats/tests/AlternativeSuite.scala index c6d3ac6638..1a067ad7de 100644 --- a/tests/src/test/scala/cats/tests/AlternativeSuite.scala +++ b/tests/src/test/scala/cats/tests/AlternativeSuite.scala @@ -1,5 +1,7 @@ -package cats -package tests +package cats.tests + +import cats.Alternative +import cats.instances.all._ class AlternativeSuite extends CatsSuite { test("unite") { diff --git a/tests/src/test/scala/cats/tests/AndThenSuite.scala b/tests/src/test/scala/cats/tests/AndThenSuite.scala index 0da370e527..fc734b6cbc 100644 --- a/tests/src/test/scala/cats/tests/AndThenSuite.scala +++ b/tests/src/test/scala/cats/tests/AndThenSuite.scala @@ -1,12 +1,13 @@ -package cats -package tests +package cats.tests -import cats.data._ +import cats.{Contravariant, ContravariantMonoidal, Monad, Semigroupal} +import cats.arrow.{ArrowChoice, Choice, CommutativeArrow} +import cats.data.AndThen +import cats.instances.all._ import cats.kernel.laws.discipline.SerializableTests import cats.laws.discipline._ -import cats.arrow._ -import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ +import cats.laws.discipline.eq._ import cats.platform.Platform import org.scalatestplus.scalacheck.Checkers diff --git a/tests/src/test/scala/cats/tests/ApplicativeErrorSuite.scala b/tests/src/test/scala/cats/tests/ApplicativeErrorSuite.scala index 2730cfd57b..d69ef995de 100644 --- a/tests/src/test/scala/cats/tests/ApplicativeErrorSuite.scala +++ b/tests/src/test/scala/cats/tests/ApplicativeErrorSuite.scala @@ -1,7 +1,12 @@ -package cats -package tests +package cats.tests +import cats.ApplicativeError import cats.data.EitherT +import cats.instances.all._ +import cats.kernel.Eq +import cats.syntax.applicativeError._ +import cats.syntax.either._ +import cats.syntax.option._ class ApplicativeErrorSuite extends CatsSuite { val failed: Option[Int] = diff --git a/tests/src/test/scala/cats/tests/ApplicativeSuite.scala b/tests/src/test/scala/cats/tests/ApplicativeSuite.scala index 1ba74c2b54..b44b9b7fa0 100644 --- a/tests/src/test/scala/cats/tests/ApplicativeSuite.scala +++ b/tests/src/test/scala/cats/tests/ApplicativeSuite.scala @@ -1,12 +1,13 @@ -package cats -package tests +package cats.tests -import cats.Applicative -import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} +import cats.{Align, Applicative, Apply, CoflatMap} import cats.data.{Const, Validated} +import cats.instances.all._ +import cats.kernel.Monoid +import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} import cats.laws.discipline.arbitrary._ -import cats.laws.discipline.CoflatMapTests -import cats.laws.discipline.AlignTests +import cats.laws.discipline.{AlignTests, CoflatMapTests} +import cats.syntax.applicative._ class ApplicativeSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/AsSuite.scala b/tests/src/test/scala/cats/tests/AsSuite.scala index 4850843ae8..82cfef919b 100644 --- a/tests/src/test/scala/cats/tests/AsSuite.scala +++ b/tests/src/test/scala/cats/tests/AsSuite.scala @@ -1,11 +1,12 @@ -package cats -package tests +package cats.tests +import cats.kernel.Eq import cats.laws.discipline.{CategoryTests, SerializableTests} import org.scalacheck.{Arbitrary, Gen} import cats.arrow.Category + class AsSuite extends CatsSuite { - import evidence._ + import cats.evidence._ def toMap[A, B, X](fa: List[X])(implicit ev: X <~< (A, B)): Map[A, B] = { type RequiredFunc = (Map[A, B], X) => Map[A, B] diff --git a/tests/src/test/scala/cats/tests/BifoldableSuite.scala b/tests/src/test/scala/cats/tests/BifoldableSuite.scala index 725035e70a..6678055c62 100644 --- a/tests/src/test/scala/cats/tests/BifoldableSuite.scala +++ b/tests/src/test/scala/cats/tests/BifoldableSuite.scala @@ -1,7 +1,9 @@ -package cats -package tests +package cats.tests +import cats.Bifoldable +import cats.instances.all._ import cats.laws.discipline.{BifoldableTests, SerializableTests} +import cats.syntax.either._ class BifoldableSuite extends CatsSuite { type EitherEither[A, B] = Either[Either[A, B], Either[A, B]] diff --git a/tests/src/test/scala/cats/tests/BifunctorSuite.scala b/tests/src/test/scala/cats/tests/BifunctorSuite.scala index e2a9409f5a..106ae99aac 100644 --- a/tests/src/test/scala/cats/tests/BifunctorSuite.scala +++ b/tests/src/test/scala/cats/tests/BifunctorSuite.scala @@ -1,7 +1,7 @@ -package cats -package tests +package cats.tests -import cats.Bifunctor +import cats.{Bifunctor, Functor} +import cats.instances.all._ import cats.laws.discipline.{BifunctorTests, FunctorTests, SerializableTests} class BifunctorSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala b/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala index 105419c283..8a51c12929 100644 --- a/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala +++ b/tests/src/test/scala/cats/tests/BinCodecInvariantMonoidalSuite.scala @@ -1,14 +1,14 @@ -package cats -package tests +package cats.tests +import cats.{InvariantMonoidal, InvariantSemigroupal} +import cats.implicits._ +import cats.kernel.{Eq, Monoid, Semigroup} +import cats.kernel.compat.scalaVersionSpecific._ +import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.{ExhaustiveCheck, InvariantMonoidalTests, MiniInt, SerializableTests} -import cats.implicits._ -import cats.Eq -import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} import org.scalacheck.{Arbitrary, Gen} -import kernel.compat.scalaVersionSpecific._ @suppressUnusedImportWarningForScalaVersionSpecific object BinCodecInvariantMonoidalSuite { diff --git a/tests/src/test/scala/cats/tests/BinestedSuite.scala b/tests/src/test/scala/cats/tests/BinestedSuite.scala index 834edb838a..90458ccede 100644 --- a/tests/src/test/scala/cats/tests/BinestedSuite.scala +++ b/tests/src/test/scala/cats/tests/BinestedSuite.scala @@ -1,12 +1,15 @@ -package cats -package tests +package cats.tests +import cats.{Bifoldable, Bifunctor, Bitraverse, Foldable, Functor, Traverse} import cats.arrow.Profunctor import cats.data.Binested - +import cats.kernel.Eq +import cats.instances.all._ import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ +import cats.syntax.bifunctor._ +import cats.syntax.binested._ class BinestedSuite extends CatsSuite { // we have a lot of generated lists of lists in these tests. We have to tell diff --git a/tests/src/test/scala/cats/tests/BitSetSuite.scala b/tests/src/test/scala/cats/tests/BitSetSuite.scala index a2cfb3aacf..d9e0a06d6c 100644 --- a/tests/src/test/scala/cats/tests/BitSetSuite.scala +++ b/tests/src/test/scala/cats/tests/BitSetSuite.scala @@ -1,8 +1,9 @@ package cats.tests +import cats.instances.all._ +import cats.syntax.show._ import org.scalacheck.Arbitrary import org.scalacheck.Arbitrary.arbitrary - import scala.collection.immutable.BitSet class BitSetSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/BitraverseSuite.scala b/tests/src/test/scala/cats/tests/BitraverseSuite.scala index 8c8c47e401..910a230090 100644 --- a/tests/src/test/scala/cats/tests/BitraverseSuite.scala +++ b/tests/src/test/scala/cats/tests/BitraverseSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.Bitraverse +import cats.instances.all._ import cats.laws.discipline.{BitraverseTests, SerializableTests} class BitraverseSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/CategorySuite.scala b/tests/src/test/scala/cats/tests/CategorySuite.scala index 0f6c62ffb9..090e04ce43 100644 --- a/tests/src/test/scala/cats/tests/CategorySuite.scala +++ b/tests/src/test/scala/cats/tests/CategorySuite.scala @@ -1,9 +1,9 @@ -package cats -package tests - -import cats.kernel.laws.discipline.MonoidTests +package cats.tests +import cats.Endo import cats.arrow.Category +import cats.instances.all._ +import cats.kernel.laws.discipline.MonoidTests import cats.laws.discipline.{MiniInt, MonoidKTests, SerializableTests} import cats.laws.discipline.eq.catsLawsEqForFn1Exhaustive import cats.laws.discipline.arbitrary.{catsLawsArbitraryForMiniInt, catsLawsCogenForMiniInt} diff --git a/tests/src/test/scala/cats/tests/CatsEquality.scala b/tests/src/test/scala/cats/tests/CatsEquality.scala index dcd550a495..36ed9e49f6 100644 --- a/tests/src/test/scala/cats/tests/CatsEquality.scala +++ b/tests/src/test/scala/cats/tests/CatsEquality.scala @@ -1,6 +1,6 @@ -package cats -package tests +package cats.tests +import cats.kernel.Eq import org.scalactic._ import TripleEqualsSupport.AToBEquivalenceConstraint import TripleEqualsSupport.BToAEquivalenceConstraint diff --git a/tests/src/test/scala/cats/tests/CatsSuite.scala b/tests/src/test/scala/cats/tests/CatsSuite.scala index 9c90dc2f2a..e6c00f5bc3 100644 --- a/tests/src/test/scala/cats/tests/CatsSuite.scala +++ b/tests/src/test/scala/cats/tests/CatsSuite.scala @@ -1,9 +1,6 @@ -package cats -package tests +package cats.tests -import cats.instances._ import cats.platform.Platform -import cats.syntax._ import org.scalactic.anyvals.{PosInt, PosZDouble, PosZInt} import org.scalatest.funsuite.AnyFunSuiteLike import org.scalatest.matchers.should.Matchers @@ -37,31 +34,11 @@ trait CatsSuite with ScalaCheckDrivenPropertyChecks with FunSuiteDiscipline with TestSettings - with AllInstances - with AllInstancesBinCompat0 - with AllInstancesBinCompat1 - with AllInstancesBinCompat2 - with AllInstancesBinCompat3 - with AllInstancesBinCompat4 - with AllInstancesBinCompat5 - with AllInstancesBinCompat6 - with AllSyntax - with AllSyntaxBinCompat0 - with AllSyntaxBinCompat1 - with AllSyntaxBinCompat2 - with AllSyntaxBinCompat3 - with AllSyntaxBinCompat4 - with AllSyntaxBinCompat5 - with AllSyntaxBinCompat6 with StrictCatsEquality { implicit override val generatorDrivenConfig: PropertyCheckConfiguration = checkConfiguration - // disable Eq syntax (by making `catsSyntaxEq` not implicit), since it collides - // with scalactic's equality - override def catsSyntaxEq[A: Eq](a: A): EqOps[A] = new EqOps[A](a) - def even(i: Int): Boolean = i % 2 == 0 val evenPf: PartialFunction[Int, Int] = { case i if even(i) => i } diff --git a/tests/src/test/scala/cats/tests/ChainSuite.scala b/tests/src/test/scala/cats/tests/ChainSuite.scala index f5bd01991c..0ac78c2d81 100644 --- a/tests/src/test/scala/cats/tests/ChainSuite.scala +++ b/tests/src/test/scala/cats/tests/ChainSuite.scala @@ -1,9 +1,12 @@ -package cats -package tests +package cats.tests +import cats.{Align, Alternative, CoflatMap, Monad, Show, Traverse, TraverseFilter} import cats.data.Chain import cats.data.Chain.==: import cats.data.Chain.`:==` +import cats.instances.all._ +import cats.kernel.{Eq, Hash, Monoid, Order, PartialOrder} +import cats.kernel.laws.discipline.{EqTests, HashTests, MonoidTests, OrderTests, PartialOrderTests} import cats.laws.discipline.{ AlignTests, AlternativeTests, @@ -13,8 +16,9 @@ import cats.laws.discipline.{ TraverseFilterTests, TraverseTests } -import cats.kernel.laws.discipline.{EqTests, HashTests, MonoidTests, OrderTests, PartialOrderTests} import cats.laws.discipline.arbitrary._ +import cats.syntax.foldable._ +import cats.syntax.semigroup._ class ChainSuite extends CatsSuite { checkAll("Chain[Int]", AlternativeTests[Chain].alternative[Int, Int, Int]) diff --git a/tests/src/test/scala/cats/tests/CokleisliSuite.scala b/tests/src/test/scala/cats/tests/CokleisliSuite.scala index 24a9964024..0a9429485f 100644 --- a/tests/src/test/scala/cats/tests/CokleisliSuite.scala +++ b/tests/src/test/scala/cats/tests/CokleisliSuite.scala @@ -1,9 +1,10 @@ -package cats -package tests +package cats.tests -import cats.Contravariant +import cats.{Contravariant, Id, Monad, MonoidK, SemigroupK, Semigroupal} import cats.arrow._ import cats.data.{Cokleisli, NonEmptyList} +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ diff --git a/tests/src/test/scala/cats/tests/ComposeSuite.scala b/tests/src/test/scala/cats/tests/ComposeSuite.scala index 07bad67dc5..07a1a08ff3 100644 --- a/tests/src/test/scala/cats/tests/ComposeSuite.scala +++ b/tests/src/test/scala/cats/tests/ComposeSuite.scala @@ -1,11 +1,13 @@ -package cats -package tests +package cats.tests -import cats.kernel.laws.discipline.SemigroupTests +import cats.Endo import cats.arrow.Compose +import cats.instances.all._ +import cats.kernel.laws.discipline.SemigroupTests import cats.laws.discipline.{MiniInt, SemigroupKTests, SerializableTests} import cats.laws.discipline.eq.catsLawsEqForFn1Exhaustive import cats.laws.discipline.arbitrary._ +import cats.syntax.compose._ class ComposeSuite extends CatsSuite { val functionCompose = Compose[Function1] diff --git a/tests/src/test/scala/cats/tests/ConstSuite.scala b/tests/src/test/scala/cats/tests/ConstSuite.scala index a213ff1b45..5c0db99b2f 100644 --- a/tests/src/test/scala/cats/tests/ConstSuite.scala +++ b/tests/src/test/scala/cats/tests/ConstSuite.scala @@ -1,6 +1,9 @@ -package cats -package tests +package cats.tests +import cats._ +import cats.data.{Const, NonEmptyList} +import cats.instances.all._ +import cats.kernel.Semigroup import cats.kernel.laws.discipline.{ EqTests, LowerBoundedTests, @@ -10,10 +13,10 @@ import cats.kernel.laws.discipline.{ SemigroupTests, UpperBoundedTests } -import cats.data.{Const, NonEmptyList} import cats.laws.discipline._ import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline.arbitrary._ +import cats.syntax.show._ import cats.tests.Helpers.{CMono, CSemi} class ConstSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/ContTSuite.scala b/tests/src/test/scala/cats/tests/ContTSuite.scala index 8a50044f14..ddb55e33d4 100644 --- a/tests/src/test/scala/cats/tests/ContTSuite.scala +++ b/tests/src/test/scala/cats/tests/ContTSuite.scala @@ -1,7 +1,9 @@ -package cats -package tests +package cats.tests +import cats.Eval import cats.data.ContT +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import org.scalacheck.{Arbitrary, Gen} diff --git a/tests/src/test/scala/cats/tests/ContravariantSuite.scala b/tests/src/test/scala/cats/tests/ContravariantSuite.scala index db680b2de9..408c3702b4 100644 --- a/tests/src/test/scala/cats/tests/ContravariantSuite.scala +++ b/tests/src/test/scala/cats/tests/ContravariantSuite.scala @@ -1,12 +1,14 @@ -package cats -package tests +package cats.tests +import cats.{Contravariant, ContravariantMonoidal, ContravariantSemigroupal} import cats.data.Const +import cats.instances.all._ +import cats.kernel.{Eq, Monoid, Semigroup} import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} import cats.laws.discipline.{ContravariantMonoidalTests, ExhaustiveCheck, MiniInt} -import org.scalacheck.{Arbitrary, Cogen} -import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ +import cats.laws.discipline.eq._ +import org.scalacheck.{Arbitrary, Cogen} class ContravariantSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/DurationSuite.scala b/tests/src/test/scala/cats/tests/DurationSuite.scala index dcd6d2a202..317a332d75 100644 --- a/tests/src/test/scala/cats/tests/DurationSuite.scala +++ b/tests/src/test/scala/cats/tests/DurationSuite.scala @@ -1,8 +1,8 @@ -package cats -package tests +package cats.tests +import cats.Show +import cats.instances.all._ import cats.laws.discipline.SerializableTests - import scala.concurrent.duration.{Duration, DurationInt} class DurationSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/EitherKSuite.scala b/tests/src/test/scala/cats/tests/EitherKSuite.scala index e858160805..a76b6521d8 100644 --- a/tests/src/test/scala/cats/tests/EitherKSuite.scala +++ b/tests/src/test/scala/cats/tests/EitherKSuite.scala @@ -1,8 +1,9 @@ package cats.tests import cats._ -import cats.kernel.laws.discipline.EqTests import cats.data.EitherK +import cats.instances.all._ +import cats.kernel.laws.discipline.EqTests import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ diff --git a/tests/src/test/scala/cats/tests/EitherSuite.scala b/tests/src/test/scala/cats/tests/EitherSuite.scala index 4ba770dc40..0622420829 100644 --- a/tests/src/test/scala/cats/tests/EitherSuite.scala +++ b/tests/src/test/scala/cats/tests/EitherSuite.scala @@ -1,13 +1,14 @@ -package cats -package tests +package cats.tests +import cats._ import cats.data.{EitherT, NonEmptyChain, NonEmptyList, NonEmptySet, Validated} -import cats.laws.discipline._ import cats.kernel.laws.discipline.{EqTests, MonoidTests, OrderTests, PartialOrderTests, SemigroupTests} -import org.scalatest.funsuite.AnyFunSuiteLike +import cats.instances.all._ +import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms - +import cats.syntax.either._ +import org.scalatest.funsuite.AnyFunSuiteLike import scala.util.Try class EitherSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/EitherTSuite.scala b/tests/src/test/scala/cats/tests/EitherTSuite.scala index 96d97c9526..a22037e38a 100644 --- a/tests/src/test/scala/cats/tests/EitherTSuite.scala +++ b/tests/src/test/scala/cats/tests/EitherTSuite.scala @@ -1,12 +1,15 @@ -package cats -package tests +package cats.tests +import cats._ import cats.data.{EitherT, State} +import cats.instances.all._ +import cats.kernel.laws.discipline.{EqTests, MonoidTests, OrderTests, PartialOrderTests, SemigroupTests} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms -import cats.kernel.laws.discipline.{EqTests, MonoidTests, OrderTests, PartialOrderTests, SemigroupTests} - +import cats.syntax.applicative._ +import cats.syntax.applicativeError._ +import cats.syntax.either._ import scala.util.{Failure, Success, Try} class EitherTSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/EqSuite.scala b/tests/src/test/scala/cats/tests/EqSuite.scala index 6898df5828..6a899235a3 100644 --- a/tests/src/test/scala/cats/tests/EqSuite.scala +++ b/tests/src/test/scala/cats/tests/EqSuite.scala @@ -1,6 +1,8 @@ -package cats -package tests +package cats.tests +import cats.{Contravariant, ContravariantMonoidal, ContravariantSemigroupal, Invariant, Semigroupal} +import cats.instances.all._ +import cats.kernel.Eq import cats.kernel.laws.discipline.SerializableTests import cats.laws.discipline.{ContravariantMonoidalTests, MiniInt} import cats.laws.discipline.arbitrary._ diff --git a/tests/src/test/scala/cats/tests/EquivSuite.scala b/tests/src/test/scala/cats/tests/EquivSuite.scala index a443441e42..7ca3f0f1de 100644 --- a/tests/src/test/scala/cats/tests/EquivSuite.scala +++ b/tests/src/test/scala/cats/tests/EquivSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.{Contravariant, ContravariantMonoidal, ContravariantSemigroupal, Invariant, Semigroupal} +import cats.instances.all._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline._ import cats.laws.discipline.eq._ diff --git a/tests/src/test/scala/cats/tests/EvalSuite.scala b/tests/src/test/scala/cats/tests/EvalSuite.scala index 8e9c6a7ed0..52c3f42046 100644 --- a/tests/src/test/scala/cats/tests/EvalSuite.scala +++ b/tests/src/test/scala/cats/tests/EvalSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.{Bimonad, CommutativeMonad, Eval, Reducible} +import cats.instances.all._ import cats.laws.ComonadLaws import cats.laws.discipline.{ BimonadTests, @@ -11,6 +12,7 @@ import cats.laws.discipline.{ SerializableTests } import cats.laws.discipline.arbitrary._ +import cats.kernel.{Eq, Monoid, Order, PartialOrder, Semigroup} import cats.kernel.laws.discipline.{EqTests, GroupTests, MonoidTests, OrderTests, PartialOrderTests, SemigroupTests} import org.scalacheck.{Arbitrary, Cogen, Gen} import org.scalacheck.Arbitrary.arbitrary diff --git a/tests/src/test/scala/cats/tests/ExtraRegressionSuite.scala b/tests/src/test/scala/cats/tests/ExtraRegressionSuite.scala index d716cca6f5..fa0778da00 100644 --- a/tests/src/test/scala/cats/tests/ExtraRegressionSuite.scala +++ b/tests/src/test/scala/cats/tests/ExtraRegressionSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.Show +import cats.instances.all._ import ExtraRegressionSuite._ class ExtraRegressionSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala b/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala index 7d417dc92c..c7f20550ae 100644 --- a/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala +++ b/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala @@ -1,8 +1,8 @@ -package cats -package tests +package cats.tests +import cats.Show +import cats.instances.all._ import cats.laws.discipline.SerializableTests - import scala.concurrent.duration.{DurationInt, FiniteDuration} class FiniteDurationSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/FoldableSuite.scala b/tests/src/test/scala/cats/tests/FoldableSuite.scala index 71be48f86c..5f01be02fc 100644 --- a/tests/src/test/scala/cats/tests/FoldableSuite.scala +++ b/tests/src/test/scala/cats/tests/FoldableSuite.scala @@ -1,13 +1,21 @@ -package cats -package tests +package cats.tests -import org.scalacheck.Arbitrary -import scala.util.Try -import scala.collection.immutable.{SortedMap, SortedSet} +import cats.{Eval, Foldable, Id, Now} +import cats.data.{Const, EitherK, IdT, Ior, Nested, NonEmptyList, NonEmptyStream, NonEmptyVector, OneAnd, Validated} import cats.instances.all._ -import cats.data._ +import cats.kernel.{Eq, Monoid} +import cats.kernel.compat.scalaVersionSpecific._ import cats.laws.discipline.arbitrary._ -import kernel.compat.scalaVersionSpecific._ +import cats.syntax.alternative._ +import cats.syntax.either._ +import cats.syntax.foldable._ +import cats.syntax.functor._ +import cats.syntax.list._ +import cats.syntax.reducible._ +import cats.syntax.semigroupk._ +import org.scalacheck.Arbitrary +import scala.collection.immutable.{SortedMap, SortedSet} +import scala.util.Try @suppressUnusedImportWarningForScalaVersionSpecific abstract class FoldableSuite[F[_]: Foldable](name: String)(implicit ArbFInt: Arbitrary[F[Int]], diff --git a/tests/src/test/scala/cats/tests/FuncSuite.scala b/tests/src/test/scala/cats/tests/FuncSuite.scala index dd3da634b8..841cdd1c6f 100644 --- a/tests/src/test/scala/cats/tests/FuncSuite.scala +++ b/tests/src/test/scala/cats/tests/FuncSuite.scala @@ -1,9 +1,10 @@ -package cats -package tests +package cats.tests +import cats.{Applicative, Apply, Contravariant, Functor, Semigroupal, Show} import cats.data.{AppFunc, Func} -import Func.appFunc -import cats.Contravariant +import cats.data.Func.appFunc +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms diff --git a/tests/src/test/scala/cats/tests/FunctionKSuite.scala b/tests/src/test/scala/cats/tests/FunctionKSuite.scala index d20841ec19..46226d3b08 100644 --- a/tests/src/test/scala/cats/tests/FunctionKSuite.scala +++ b/tests/src/test/scala/cats/tests/FunctionKSuite.scala @@ -1,9 +1,10 @@ -package cats -package tests +package cats.tests +import cats.Id import cats.arrow.FunctionK import cats.data.EitherK import cats.data.NonEmptyList +import cats.instances.all._ import cats.laws.discipline.arbitrary._ class FunctionKSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/FunctionSuite.scala b/tests/src/test/scala/cats/tests/FunctionSuite.scala index d2340a9f18..7fefc1fb75 100644 --- a/tests/src/test/scala/cats/tests/FunctionSuite.scala +++ b/tests/src/test/scala/cats/tests/FunctionSuite.scala @@ -1,7 +1,21 @@ -package cats -package tests - +package cats.tests + +import cats.{ + Applicative, + Bimonad, + Contravariant, + ContravariantMonoidal, + Defer, + Distributive, + Endo, + Id, + Monad, + MonoidK, + Semigroupal +} import cats.arrow.{ArrowChoice, Choice, CommutativeArrow} +import cats.instances.all._ +import cats.kernel._ import cats.kernel.laws.HashLaws import cats.kernel.laws.discipline.{ BandTests, @@ -19,11 +33,10 @@ import cats.kernel.laws.discipline.{ SerializableTests } import cats.laws.discipline._ +import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ -import cats.laws.discipline.SemigroupalTests.Isomorphisms -import cats.kernel.{CommutativeGroup, CommutativeMonoid, CommutativeSemigroup} -import cats.kernel.{Band, BoundedSemilattice, Semilattice} +import cats.syntax.foldable._ import org.scalacheck.Gen class FunctionSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/FunctorSuite.scala b/tests/src/test/scala/cats/tests/FunctorSuite.scala index ea04d16912..12027b2abf 100644 --- a/tests/src/test/scala/cats/tests/FunctorSuite.scala +++ b/tests/src/test/scala/cats/tests/FunctorSuite.scala @@ -1,5 +1,8 @@ -package cats -package tests +package cats.tests + +import cats.Functor +import cats.instances.all._ +import cats.syntax.functor._ class FunctorSuite extends CatsSuite { test("void replaces values with unit preserving structure") { diff --git a/tests/src/test/scala/cats/tests/GroupSuite.scala b/tests/src/test/scala/cats/tests/GroupSuite.scala index 30823e07de..43f6c97fea 100644 --- a/tests/src/test/scala/cats/tests/GroupSuite.scala +++ b/tests/src/test/scala/cats/tests/GroupSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.instances.all._ +import cats.kernel.Group import cats.kernel.laws.discipline.GroupTests class GroupSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/HashSuite.scala b/tests/src/test/scala/cats/tests/HashSuite.scala index b0f368867d..5ed1505342 100644 --- a/tests/src/test/scala/cats/tests/HashSuite.scala +++ b/tests/src/test/scala/cats/tests/HashSuite.scala @@ -1,5 +1,9 @@ -package cats -package tests +package cats.tests + +import cats.{Contravariant, Invariant} +import cats.instances.all._ +import cats.kernel.Hash +import cats.syntax.hash._ class HashSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/IdSuite.scala b/tests/src/test/scala/cats/tests/IdSuite.scala index 35c53f1da5..3f9becd4b3 100644 --- a/tests/src/test/scala/cats/tests/IdSuite.scala +++ b/tests/src/test/scala/cats/tests/IdSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.{Bimonad, CommutativeMonad, Id, Reducible, Traverse} +import cats.instances.all._ import cats.laws.discipline._ class IdSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/IdTSuite.scala b/tests/src/test/scala/cats/tests/IdTSuite.scala index 7302a56155..12a81fb40d 100644 --- a/tests/src/test/scala/cats/tests/IdTSuite.scala +++ b/tests/src/test/scala/cats/tests/IdTSuite.scala @@ -1,12 +1,13 @@ -package cats -package tests +package cats.tests +import cats._ import cats.data.{Const, IdT, NonEmptyList} +import cats.instances.all._ import cats.kernel.laws.discipline.{EqTests, OrderTests} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms -import Helpers.CSemi +import cats.tests.Helpers.CSemi class IdTSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala b/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala index d400344ce3..61162dac0b 100644 --- a/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala +++ b/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala @@ -1,14 +1,18 @@ -package cats -package tests +package cats.tests +import cats.{~>, Bifunctor, Contravariant, Eval, Functor, Id, Monad, MonadError, SemigroupK} +import cats.arrow.{Profunctor, Strong} import cats.data.{EitherT, IRWST, IndexedReaderWriterStateT, ReaderWriterState, ReaderWriterStateT} - +import cats.instances.all._ +import cats.kernel.{Eq, Monoid} import cats.laws.discipline._ import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms +import cats.syntax.apply._ +import cats.syntax.semigroup._ +import cats.syntax.traverse._ import org.scalacheck.Arbitrary -import cats.arrow.{Profunctor, Strong} class ReaderWriterStateTSuite extends CatsSuite { import ReaderWriterStateTSuite._ diff --git a/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala b/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala index 35987f8f2e..a55b30b680 100644 --- a/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala +++ b/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala @@ -1,15 +1,18 @@ -package cats -package tests +package cats.tests +import cats._ import cats.arrow.{Profunctor, Strong} import cats.data.{EitherT, IndexedStateT, State, StateT} -import cats.arrow.Profunctor -import cats.kernel.instances.tuple._ +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline._ +import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ -import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.platform.Platform +import cats.syntax.apply._ +import cats.syntax.flatMap._ +import cats.syntax.traverse._ class IndexedStateTSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/InjectKSuite.scala b/tests/src/test/scala/cats/tests/InjectKSuite.scala index 64ec95219c..23b7ddb617 100644 --- a/tests/src/test/scala/cats/tests/InjectKSuite.scala +++ b/tests/src/test/scala/cats/tests/InjectKSuite.scala @@ -1,8 +1,10 @@ -package cats +package cats.tests +import cats.{:<:, Functor, InjectK} import cats.data.EitherK +import cats.kernel.Eq +import cats.instances.all._ import cats.laws.discipline.InjectKTests -import cats.tests.CatsSuite import org.scalacheck._ class InjectKSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/InjectSuite.scala b/tests/src/test/scala/cats/tests/InjectSuite.scala index 633ad13918..c6b024d63a 100644 --- a/tests/src/test/scala/cats/tests/InjectSuite.scala +++ b/tests/src/test/scala/cats/tests/InjectSuite.scala @@ -1,7 +1,8 @@ -package cats +package cats.tests +import cats.Inject +import cats.instances.all._ import cats.laws.discipline.InjectTests -import cats.tests.CatsSuite class InjectSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/IorSuite.scala b/tests/src/test/scala/cats/tests/IorSuite.scala index f4c308df1e..dc2186fe25 100644 --- a/tests/src/test/scala/cats/tests/IorSuite.scala +++ b/tests/src/test/scala/cats/tests/IorSuite.scala @@ -1,6 +1,9 @@ -package cats -package tests +package cats.tests +import cats.{Bitraverse, MonadError, Semigroupal, Show, Traverse} +import cats.data.{EitherT, Ior, NonEmptyChain, NonEmptyList, NonEmptySet} +import cats.instances.all._ +import cats.kernel.{Eq, Semigroup} import cats.kernel.laws.discipline.SemigroupTests import cats.laws.discipline.{ BifunctorTests, @@ -10,9 +13,8 @@ import cats.laws.discipline.{ SerializableTests, TraverseTests } -import cats.data.{EitherT, Ior, NonEmptyChain, NonEmptyList, NonEmptySet} -import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms +import cats.laws.discipline.arbitrary._ import org.scalacheck.Arbitrary._ class IorSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/IorTSuite.scala b/tests/src/test/scala/cats/tests/IorTSuite.scala index 2e5ece0c5a..ffce078b21 100644 --- a/tests/src/test/scala/cats/tests/IorTSuite.scala +++ b/tests/src/test/scala/cats/tests/IorTSuite.scala @@ -1,7 +1,9 @@ -package cats -package tests +package cats.tests +import cats.{~>, Bifunctor, Eval, Foldable, Functor, Id, Monad, MonadError, Traverse} import cats.data.{Ior, IorT} +import cats.instances.all._ +import cats.kernel.{Eq, Monoid, Semigroup} import cats.kernel.laws.discipline.{EqTests, MonoidTests, SemigroupTests} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ diff --git a/tests/src/test/scala/cats/tests/IsSuite.scala b/tests/src/test/scala/cats/tests/IsSuite.scala index 26f5bb827e..a17398cfd3 100644 --- a/tests/src/test/scala/cats/tests/IsSuite.scala +++ b/tests/src/test/scala/cats/tests/IsSuite.scala @@ -1,14 +1,13 @@ -package cats -package tests +package cats.tests import cats.arrow._ +import cats.evidence.{Is, Leibniz} +import cats.kernel.Eq import cats.kernel.laws.discipline.SerializableTests import cats.laws.discipline.CategoryTests import org.scalacheck.{Arbitrary, Gen} class IsSuite extends CatsSuite { - import evidence._ - implicit def arbIs[A, B](implicit ev: A Is B): Arbitrary[A Is B] = Arbitrary(Gen.const(ev)) implicit def eqIs[A, B]: Eq[A Is B] = Eq.fromUniversalEquals diff --git a/tests/src/test/scala/cats/tests/KernelContravariantSuite.scala b/tests/src/test/scala/cats/tests/KernelContravariantSuite.scala index 420bb4116e..65701e34eb 100644 --- a/tests/src/test/scala/cats/tests/KernelContravariantSuite.scala +++ b/tests/src/test/scala/cats/tests/KernelContravariantSuite.scala @@ -1,6 +1,8 @@ -package cats -package tests +package cats.tests +import cats.{Contravariant, ContravariantSemigroupal, Invariant, Semigroupal} +import cats.instances.all._ +import cats.kernel.{Eq, Hash, Order, PartialOrder} import cats.laws.discipline.arbitrary._ import cats.laws.discipline._ import cats.laws.discipline.eq._ diff --git a/tests/src/test/scala/cats/tests/KleisliSuite.scala b/tests/src/test/scala/cats/tests/KleisliSuite.scala index aa42a7540c..410840b9d1 100644 --- a/tests/src/test/scala/cats/tests/KleisliSuite.scala +++ b/tests/src/test/scala/cats/tests/KleisliSuite.scala @@ -1,17 +1,20 @@ -package cats -package tests +package cats.tests -import cats.Contravariant +import cats._ import cats.arrow._ import cats.data.{Const, EitherT, Kleisli, Reader, ReaderT} +import cats.instances.all._ +import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ import cats.laws.discipline.SemigroupalTests.Isomorphisms -import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} import cats.laws.discipline.{DeferTests, MonoidKTests, SemigroupKTests} +import cats.syntax.flatMap._ +import cats.syntax.functor._ +import cats.syntax.traverse._ import cats.platform.Platform -import Helpers.CSemi +import cats.tests.Helpers.CSemi class KleisliSuite extends CatsSuite { implicit def kleisliEq[F[_], A, B](implicit ev: Eq[A => F[B]]): Eq[Kleisli[F, A, B]] = diff --git a/tests/src/test/scala/cats/tests/ListSuite.scala b/tests/src/test/scala/cats/tests/ListSuite.scala index b9e8b71660..710d7e5cc4 100644 --- a/tests/src/test/scala/cats/tests/ListSuite.scala +++ b/tests/src/test/scala/cats/tests/ListSuite.scala @@ -1,7 +1,8 @@ -package cats -package tests +package cats.tests +import cats.{Align, Alternative, CoflatMap, Monad, Semigroupal, Traverse, TraverseFilter} import cats.data.{NonEmptyList, ZipList} +import cats.instances.all._ import cats.laws.discipline.{ AlignTests, AlternativeTests, @@ -14,6 +15,8 @@ import cats.laws.discipline.{ TraverseTests } import cats.laws.discipline.arbitrary._ +import cats.syntax.list._ +import cats.syntax.show._ import org.scalatest.funsuite.AnyFunSuiteLike class ListSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/MapSuite.scala b/tests/src/test/scala/cats/tests/MapSuite.scala index 04db588d0d..a79d09c991 100644 --- a/tests/src/test/scala/cats/tests/MapSuite.scala +++ b/tests/src/test/scala/cats/tests/MapSuite.scala @@ -1,6 +1,9 @@ -package cats -package tests +package cats.tests +import cats.{Align, FlatMap, FunctorFilter, MonoidK, Semigroupal, Show, UnorderedTraverse} +import cats.arrow.Compose +import cats.instances.all._ +import cats.kernel.instances.StaticMethods.wrapMutableMap import cats.laws.discipline.{ AlignTests, ComposeTests, @@ -12,8 +15,7 @@ import cats.laws.discipline.{ UnorderedTraverseTests } import cats.laws.discipline.arbitrary._ -import cats.arrow.Compose -import cats.kernel.instances.StaticMethods.wrapMutableMap +import cats.syntax.show._ class MapSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/MiniIntSuite.scala b/tests/src/test/scala/cats/tests/MiniIntSuite.scala index 076ae33f43..c425b8c67e 100644 --- a/tests/src/test/scala/cats/tests/MiniIntSuite.scala +++ b/tests/src/test/scala/cats/tests/MiniIntSuite.scala @@ -1,12 +1,11 @@ -package cats -package tests +package cats.tests +import cats.instances.all._ +import cats.kernel.{BoundedSemilattice, CommutativeGroup, CommutativeMonoid, Hash, Order} +import cats.kernel.laws.discipline._ import cats.laws.discipline.MiniInt -import MiniInt._ +import cats.laws.discipline.MiniInt._ import cats.laws.discipline.arbitrary._ -import cats.kernel.{BoundedSemilattice, CommutativeGroup, CommutativeMonoid} -import cats.kernel.laws.discipline._ - import org.scalacheck.Gen class MiniIntSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/MonadErrorSuite.scala b/tests/src/test/scala/cats/tests/MonadErrorSuite.scala index 47d9878d99..4694ab7e6b 100644 --- a/tests/src/test/scala/cats/tests/MonadErrorSuite.scala +++ b/tests/src/test/scala/cats/tests/MonadErrorSuite.scala @@ -1,6 +1,9 @@ -package cats -package tests +package cats.tests +import cats.instances.all._ +import cats.kernel.Eq +import cats.syntax.applicativeError._ +import cats.syntax.monadError._ import scala.util.{Failure, Success, Try} class MonadErrorSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/MonadSuite.scala b/tests/src/test/scala/cats/tests/MonadSuite.scala index 5466b38909..611142889f 100644 --- a/tests/src/test/scala/cats/tests/MonadSuite.scala +++ b/tests/src/test/scala/cats/tests/MonadSuite.scala @@ -1,7 +1,10 @@ -package cats -package tests +package cats.tests +import cats.{Id, Monad} import cats.data.{IndexedStateT, StateT} +import cats.instances.all._ +import cats.syntax.apply._ +import cats.syntax.monad._ import org.scalacheck.Gen class MonadSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/MonoidSuite.scala b/tests/src/test/scala/cats/tests/MonoidSuite.scala index 4eecd0d5b5..c93efd5616 100644 --- a/tests/src/test/scala/cats/tests/MonoidSuite.scala +++ b/tests/src/test/scala/cats/tests/MonoidSuite.scala @@ -1,5 +1,8 @@ -package cats -package tests +package cats.tests + +import cats.{Invariant, InvariantSemigroupal} +import cats.instances.all._ +import cats.kernel.Monoid class MonoidSuite extends CatsSuite { { diff --git a/tests/src/test/scala/cats/tests/NestedSuite.scala b/tests/src/test/scala/cats/tests/NestedSuite.scala index 554829e3e1..b52c28c1be 100644 --- a/tests/src/test/scala/cats/tests/NestedSuite.scala +++ b/tests/src/test/scala/cats/tests/NestedSuite.scala @@ -1,9 +1,8 @@ -package cats -package tests +package cats.tests -import cats.Functor +import cats._ import cats.data._ - +import cats.instances.all._ import cats.laws.discipline._ import cats.laws.discipline.SemigroupalTests.Isomorphisms._ import cats.laws.discipline.arbitrary._ diff --git a/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala index b269401d0d..4ba9bbf342 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala @@ -1,10 +1,14 @@ -package cats -package tests +package cats.tests +import cats.{Align, Bimonad, SemigroupK, Show, Traverse} import cats.data.{Chain, NonEmptyChain, NonEmptyChainOps} +import cats.instances.all._ +import cats.kernel.{Eq, Order, PartialOrder, Semigroup} import cats.kernel.laws.discipline.{EqTests, OrderTests, PartialOrderTests, SemigroupTests} import cats.laws.discipline.{AlignTests, BimonadTests, NonEmptyTraverseTests, SemigroupKTests, SerializableTests} import cats.laws.discipline.arbitrary._ +import cats.syntax.either._ +import cats.syntax.foldable._ class NonEmptyChainSuite extends NonEmptyCollectionSuite[Chain, NonEmptyChain, NonEmptyChainOps] { protected def toList[A](value: NonEmptyChain[A]): List[A] = value.toChain.toList diff --git a/tests/src/test/scala/cats/tests/NonEmptyCollectionSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyCollectionSuite.scala index 6433a542ce..c40457f8f7 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyCollectionSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyCollectionSuite.scala @@ -1,6 +1,7 @@ package cats.tests import cats.data.NonEmptyCollection +import cats.instances.all._ import org.scalacheck.Arbitrary abstract class NonEmptyCollectionSuite[U[+_], NE[+_], NEC[x] <: NonEmptyCollection[x, U, NE]]( diff --git a/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala index 8cc6b9c438..3ba03cff54 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala @@ -1,10 +1,11 @@ -package cats -package tests - -import cats.kernel.laws.discipline.{EqTests, OrderTests, PartialOrderTests, SemigroupTests} +package cats.tests +import cats.{Align, Bimonad, Eval, NonEmptyTraverse, Now, Reducible, SemigroupK, Show} import cats.data.{NonEmptyList, NonEmptyMap, NonEmptySet, NonEmptyVector} import cats.data.NonEmptyList.ZipNonEmptyList +import cats.instances.all._ +import cats.kernel.{Eq, Order, PartialOrder, Semigroup} +import cats.kernel.laws.discipline.{EqTests, OrderTests, PartialOrderTests, SemigroupTests} import cats.laws.discipline.arbitrary._ import cats.laws.discipline.{ AlignTests, @@ -15,8 +16,10 @@ import cats.laws.discipline.{ SemigroupKTests, SerializableTests } -import scala.collection.immutable.SortedMap -import scala.collection.immutable.SortedSet +import cats.syntax.foldable._ +import cats.syntax.reducible._ +import cats.syntax.show._ +import scala.collection.immutable.{SortedMap, SortedSet} class NonEmptyListSuite extends NonEmptyCollectionSuite[List, NonEmptyList, NonEmptyList] { protected def toList[A](value: NonEmptyList[A]): List[A] = value.toList diff --git a/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala index 3b32fe3a62..d3a86de3d7 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala @@ -1,11 +1,15 @@ -package cats -package tests +package cats.tests +import cats.{Align, Eval, Foldable, Now, SemigroupK, Show} +import cats.data.{NonEmptyList, NonEmptyMap} +import cats.kernel.laws.discipline.{SerializableTests => _, _} +import cats.instances.all._ import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ -import cats.data._ -import cats.kernel.laws.discipline.{SerializableTests => _, _} - +import cats.syntax.foldable._ +import cats.syntax.functor._ +import cats.syntax.show._ +import cats.syntax.reducible._ import scala.collection.immutable.SortedMap class NonEmptyMapSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala b/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala index 115e7906d2..592bc60a5a 100644 --- a/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala @@ -1,12 +1,15 @@ -package cats -package tests +package cats.tests -import cats.laws.discipline._ -import cats.laws.discipline.arbitrary._ +import cats.{Eval, Now, Reducible, SemigroupK, Show} import cats.data.NonEmptySet -import cats.kernel.Semilattice +import cats.instances.all._ +import cats.kernel.{Eq, Order, PartialOrder, Semilattice} import cats.kernel.laws.discipline.{EqTests, HashTests, OrderTests, SemilatticeTests} - +import cats.laws.discipline._ +import cats.laws.discipline.arbitrary._ +import cats.syntax.foldable._ +import cats.syntax.reducible._ +import cats.syntax.show._ import scala.collection.immutable.SortedSet class NonEmptySetSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala index 8cd4489437..ad02ac35e0 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala @@ -1,11 +1,26 @@ -package cats -package tests - +package cats.tests + +import cats.{ + Align, + Bimonad, + CommutativeApply, + Comonad, + Eval, + Foldable, + Functor, + Monad, + NonEmptyTraverse, + Now, + Reducible, + SemigroupK, + Show, + Traverse +} +import cats.data.NonEmptyVector import cats.data.NonEmptyVector.ZipNonEmptyVector - +import cats.instances.all._ +import cats.kernel.Semigroup import cats.kernel.laws.discipline.{EqTests, SemigroupTests} - -import cats.data.NonEmptyVector import cats.laws.discipline.{ AlignTests, BimonadTests, @@ -18,7 +33,9 @@ import cats.laws.discipline.{ } import cats.laws.discipline.arbitrary._ import cats.platform.Platform - +import cats.syntax.foldable._ +import cats.syntax.reducible._ +import cats.syntax.show._ import scala.util.Properties class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector, NonEmptyVector] { diff --git a/tests/src/test/scala/cats/tests/OneAndSuite.scala b/tests/src/test/scala/cats/tests/OneAndSuite.scala index 75bf832322..3b2ad799e9 100644 --- a/tests/src/test/scala/cats/tests/OneAndSuite.scala +++ b/tests/src/test/scala/cats/tests/OneAndSuite.scala @@ -1,10 +1,12 @@ -package cats -package tests +package cats.tests +import cats.{Alternative, Applicative, Foldable, Functor, Monad, SemigroupK, Traverse} import cats.data.OneAnd +import cats.instances.all._ import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms +import cats.syntax.foldable._ class OneAndSuite extends CatsSuite { // Lots of collections here.. telling ScalaCheck to calm down a bit diff --git a/tests/src/test/scala/cats/tests/OpSuite.scala b/tests/src/test/scala/cats/tests/OpSuite.scala index a70041f041..af6e5886ea 100644 --- a/tests/src/test/scala/cats/tests/OpSuite.scala +++ b/tests/src/test/scala/cats/tests/OpSuite.scala @@ -1,8 +1,9 @@ -package cats -package tests +package cats.tests import cats.arrow._ import cats.data.{Kleisli, Op} +import cats.instances.all._ +import cats.kernel.Eq import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ diff --git a/tests/src/test/scala/cats/tests/OptionSuite.scala b/tests/src/test/scala/cats/tests/OptionSuite.scala index a41b24db4f..75ff99bde2 100644 --- a/tests/src/test/scala/cats/tests/OptionSuite.scala +++ b/tests/src/test/scala/cats/tests/OptionSuite.scala @@ -1,9 +1,13 @@ -package cats -package tests +package cats.tests +import cats.{Alternative, CoflatMap, CommutativeMonad, Eval, Later, MonadError, Semigroupal, Traverse, TraverseFilter} +import cats.instances.all._ import cats.laws.{ApplicativeLaws, CoflatMapLaws, FlatMapLaws, MonadLaws} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ +import cats.syntax.apply._ +import cats.syntax.option._ +import cats.syntax.show._ class OptionSuite extends CatsSuite { checkAll("Option[Int]", SemigroupalTests[Option].semigroupal[Int, Int, Int]) diff --git a/tests/src/test/scala/cats/tests/OptionTSuite.scala b/tests/src/test/scala/cats/tests/OptionTSuite.scala index c9ea0ae5a0..02d052e4e7 100644 --- a/tests/src/test/scala/cats/tests/OptionTSuite.scala +++ b/tests/src/test/scala/cats/tests/OptionTSuite.scala @@ -1,13 +1,15 @@ -package cats -package tests +package cats.tests +import cats._ import cats.data.{Const, IdT, OptionT} -import cats.kernel.{Monoid, Semigroup} +import cats.instances.all._ import cats.kernel.laws.discipline.{EqTests, MonoidTests, OrderTests, PartialOrderTests, SemigroupTests} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ import cats.laws.discipline.SemigroupalTests.Isomorphisms +import cats.syntax.either._ +import cats.syntax.monadError._ class OptionTSuite extends CatsSuite { implicit val iso: Isomorphisms[OptionT[ListWrapper, *]] = Isomorphisms diff --git a/tests/src/test/scala/cats/tests/OptionWrapper.scala b/tests/src/test/scala/cats/tests/OptionWrapper.scala index 540890007f..92549f7389 100644 --- a/tests/src/test/scala/cats/tests/OptionWrapper.scala +++ b/tests/src/test/scala/cats/tests/OptionWrapper.scala @@ -1,9 +1,9 @@ -package cats -package tests +package cats.tests +import cats.Functor import cats.laws.discipline.ExhaustiveCheck - -import org.scalacheck.{Arbitrary, Cogen}, Arbitrary.arbitrary +import org.scalacheck.{Arbitrary, Cogen} +import org.scalacheck.Arbitrary.arbitrary /** * Similar to [[ListWrapper]], but using `Option` instead of `List` limits the size of the structure, which can be diff --git a/tests/src/test/scala/cats/tests/OrderSuite.scala b/tests/src/test/scala/cats/tests/OrderSuite.scala index 7da7b97024..4c8789e149 100644 --- a/tests/src/test/scala/cats/tests/OrderSuite.scala +++ b/tests/src/test/scala/cats/tests/OrderSuite.scala @@ -1,11 +1,14 @@ -package cats -package tests +package cats.tests -import Helpers.Ord +import cats.{Contravariant, ContravariantMonoidal, Invariant} +import cats.instances.all._ +import cats.kernel.{Order, PartialOrder} import cats.kernel.laws.discipline.{OrderTests, SerializableTests} import cats.laws.discipline.{ContravariantMonoidalTests, MiniInt} import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ +import cats.syntax.order._ +import cats.tests.Helpers.Ord class OrderSuite extends CatsSuite { { diff --git a/tests/src/test/scala/cats/tests/OrderingSuite.scala b/tests/src/test/scala/cats/tests/OrderingSuite.scala index 5298040f80..efe99bbc89 100644 --- a/tests/src/test/scala/cats/tests/OrderingSuite.scala +++ b/tests/src/test/scala/cats/tests/OrderingSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.{Contravariant, ContravariantMonoidal, ContravariantSemigroupal, Invariant, Semigroupal} +import cats.instances.all._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline._ import cats.laws.discipline.eq._ diff --git a/tests/src/test/scala/cats/tests/ParallelSuite.scala b/tests/src/test/scala/cats/tests/ParallelSuite.scala index 3e124d959e..e5cc2e9d0b 100644 --- a/tests/src/test/scala/cats/tests/ParallelSuite.scala +++ b/tests/src/test/scala/cats/tests/ParallelSuite.scala @@ -1,17 +1,25 @@ -package cats -package tests +package cats.tests import cats._ -import cats.data.NonEmptyList.ZipNonEmptyList import cats.data._ -import org.scalatest.funsuite.AnyFunSuiteLike +import cats.data.NonEmptyList.ZipNonEmptyList +import cats.instances.all._ +import cats.kernel.compat.scalaVersionSpecific._ import cats.laws.discipline.{ApplicativeErrorTests, MiniInt, NonEmptyParallelTests, ParallelTests, SerializableTests} import cats.laws.discipline.eq._ import cats.laws.discipline.arbitrary._ +import cats.syntax.bifunctor._ +import cats.syntax.bitraverse._ +import cats.syntax.either._ +import cats.syntax.flatMap._ +import cats.syntax.foldable._ +import cats.syntax.option._ +import cats.syntax.parallel._ +import cats.syntax.traverse._ +import org.scalatest.funsuite.AnyFunSuiteLike import org.scalatestplus.scalacheck.Checkers import org.typelevel.discipline.scalatest.FunSuiteDiscipline import scala.collection.immutable.SortedSet -import kernel.compat.scalaVersionSpecific._ @suppressUnusedImportWarningForScalaVersionSpecific class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with ScalaVersionSpecificParallelSuite { diff --git a/tests/src/test/scala/cats/tests/PartialOrderSuite.scala b/tests/src/test/scala/cats/tests/PartialOrderSuite.scala index 4b8d8e4359..fd355e2719 100644 --- a/tests/src/test/scala/cats/tests/PartialOrderSuite.scala +++ b/tests/src/test/scala/cats/tests/PartialOrderSuite.scala @@ -1,12 +1,15 @@ -package cats -package tests +package cats.tests -import Helpers.POrd +import cats.{Contravariant, ContravariantMonoidal, Invariant} +import cats.instances.all._ +import cats.kernel.PartialOrder import cats.kernel.laws.discipline.SerializableTests import cats.laws.discipline.{ContravariantMonoidalTests, MiniInt} -import org.scalatest.Assertion import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ +import cats.syntax.partialOrder._ +import cats.tests.Helpers.POrd +import org.scalatest.Assertion class PartialOrderSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/PartialOrderingSuite.scala b/tests/src/test/scala/cats/tests/PartialOrderingSuite.scala index fa5f3a9991..4f8f9d8e05 100644 --- a/tests/src/test/scala/cats/tests/PartialOrderingSuite.scala +++ b/tests/src/test/scala/cats/tests/PartialOrderingSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.{Contravariant, ContravariantMonoidal, ContravariantSemigroupal, Invariant, Semigroupal} +import cats.instances.all._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline._ import cats.laws.discipline.eq._ diff --git a/tests/src/test/scala/cats/tests/QueueSuite.scala b/tests/src/test/scala/cats/tests/QueueSuite.scala index 255adc0f6f..f86dab1ec5 100644 --- a/tests/src/test/scala/cats/tests/QueueSuite.scala +++ b/tests/src/test/scala/cats/tests/QueueSuite.scala @@ -1,7 +1,7 @@ -package cats -package tests +package cats.tests -import scala.collection.immutable.Queue +import cats.{Alternative, CoflatMap, Monad, Semigroupal, Traverse, TraverseFilter} +import cats.instances.all._ import cats.laws.discipline.{ AlternativeTests, CoflatMapTests, @@ -11,6 +11,8 @@ import cats.laws.discipline.{ TraverseFilterTests, TraverseTests } +import cats.syntax.show._ +import scala.collection.immutable.Queue class QueueSuite extends CatsSuite { checkAll("Queue[Int]", SemigroupalTests[Queue].semigroupal[Int, Int, Int]) diff --git a/tests/src/test/scala/cats/tests/ReducibleSuite.scala b/tests/src/test/scala/cats/tests/ReducibleSuite.scala index f94da04ffb..cad6eb27b9 100644 --- a/tests/src/test/scala/cats/tests/ReducibleSuite.scala +++ b/tests/src/test/scala/cats/tests/ReducibleSuite.scala @@ -1,8 +1,15 @@ -package cats -package tests +package cats.tests -import org.scalacheck.Arbitrary +import cats.{Eval, NonEmptyReducible, Now, Reducible} import cats.data.NonEmptyList +import cats.kernel.Eq +import cats.instances.all._ +import cats.syntax.either._ +import cats.syntax.foldable._ +import cats.syntax.list._ +import cats.syntax.option._ +import cats.syntax.reducible._ +import org.scalacheck.Arbitrary class ReducibleSuiteAdditional extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/RegressionSuite.scala b/tests/src/test/scala/cats/tests/RegressionSuite.scala index 7af2a4cf9d..263cb0aaf6 100644 --- a/tests/src/test/scala/cats/tests/RegressionSuite.scala +++ b/tests/src/test/scala/cats/tests/RegressionSuite.scala @@ -1,10 +1,17 @@ -package cats -package tests +package cats.tests +import cats.{Apply, Monad, MonadError, StackSafeMonad, Traverse} import cats.data.{Const, NonEmptyList, StateT} +import cats.instances.all._ +import cats.kernel.Eq +import cats.kernel.compat.scalaVersionSpecific._ +import cats.syntax.applicativeError._ +import cats.syntax.either._ +import cats.syntax.foldable._ +import cats.syntax.monadError._ +import cats.syntax.traverse._ import scala.collection.mutable import scala.collection.immutable.SortedMap -import kernel.compat.scalaVersionSpecific._ @suppressUnusedImportWarningForScalaVersionSpecific class RegressionSuite extends CatsSuite with ScalaVersionSpecificRegressionSuite { @@ -149,7 +156,7 @@ class RegressionSuite extends CatsSuite with ScalaVersionSpecificRegressionSuite } test("#2022 EitherT syntax no long works the old way") { - import data._ + import cats.data._ EitherT.right[String](Option(1)).handleErrorWith((_: String) => EitherT.pure(2)) diff --git a/tests/src/test/scala/cats/tests/RepresentableStoreSuite.scala b/tests/src/test/scala/cats/tests/RepresentableStoreSuite.scala index 4c8adcb144..eccbb3cff4 100644 --- a/tests/src/test/scala/cats/tests/RepresentableStoreSuite.scala +++ b/tests/src/test/scala/cats/tests/RepresentableStoreSuite.scala @@ -2,6 +2,7 @@ package cats.tests import cats.Comonad import cats.data.{RepresentableStore, Store} +import cats.instances.all._ import cats.kernel.Eq import cats.laws.discipline.{ComonadTests, SerializableTests} import cats.laws.discipline.arbitrary._ diff --git a/tests/src/test/scala/cats/tests/RepresentableSuite.scala b/tests/src/test/scala/cats/tests/RepresentableSuite.scala index 690f66c5c6..46a4a15b85 100644 --- a/tests/src/test/scala/cats/tests/RepresentableSuite.scala +++ b/tests/src/test/scala/cats/tests/RepresentableSuite.scala @@ -1,5 +1,9 @@ package cats.tests +import cats.{Bimonad, Distributive, Eq, Eval, Id, Monad, Representable} +import cats.data.Kleisli +import cats.instances.all._ +import cats.kernel.Monoid import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ @@ -11,9 +15,8 @@ import cats.laws.discipline.{ RepresentableTests, SerializableTests } -import cats.{Bimonad, Distributive, Eq, Eval, Id, Monad, Monoid, Representable} +import cats.syntax.representable._ import org.scalacheck.Arbitrary -import cats.data.Kleisli class RepresentableSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/SemigroupKSuite.scala b/tests/src/test/scala/cats/tests/SemigroupKSuite.scala index 6eb24aab99..247419a6e7 100644 --- a/tests/src/test/scala/cats/tests/SemigroupKSuite.scala +++ b/tests/src/test/scala/cats/tests/SemigroupKSuite.scala @@ -1,8 +1,8 @@ package cats.tests -import cats.Alternative -import cats.{Align, SemigroupK} +import cats.{Align, Alternative, SemigroupK} import cats.data.{Chain, Validated} +import cats.instances.all._ import cats.laws.discipline.AlignTests import cats.laws.discipline.arbitrary._ diff --git a/tests/src/test/scala/cats/tests/SemigroupSuite.scala b/tests/src/test/scala/cats/tests/SemigroupSuite.scala index aff7fa3658..76c5117333 100644 --- a/tests/src/test/scala/cats/tests/SemigroupSuite.scala +++ b/tests/src/test/scala/cats/tests/SemigroupSuite.scala @@ -1,6 +1,7 @@ -package cats -package tests +package cats.tests +import cats.{Invariant, InvariantMonoidal, Semigroupal} +import cats.kernel.Semigroup import org.scalatest._ import org.scalatest.matchers.should.Matchers import org.scalatest.funsuite._ diff --git a/tests/src/test/scala/cats/tests/SetSuite.scala b/tests/src/test/scala/cats/tests/SetSuite.scala index a287d947af..4547818a35 100644 --- a/tests/src/test/scala/cats/tests/SetSuite.scala +++ b/tests/src/test/scala/cats/tests/SetSuite.scala @@ -1,10 +1,12 @@ -package cats -package tests +package cats.tests -import cats.kernel.laws.discipline.MonoidTests +import cats.{MonoidK, Show, UnorderedTraverse} import cats.data.Validated +import cats.instances.all._ +import cats.kernel.laws.discipline.MonoidTests import cats.laws.discipline.{MonoidKTests, SerializableTests, UnorderedTraverseTests} import cats.laws.discipline.arbitrary._ +import cats.syntax.show._ class SetSuite extends CatsSuite { checkAll("Set[Int]", MonoidTests[Set[Int]].monoid) diff --git a/tests/src/test/scala/cats/tests/ShowSuite.scala b/tests/src/test/scala/cats/tests/ShowSuite.scala index bed8913aee..2ae716c684 100644 --- a/tests/src/test/scala/cats/tests/ShowSuite.scala +++ b/tests/src/test/scala/cats/tests/ShowSuite.scala @@ -1,14 +1,15 @@ -package cats -package tests - -import java.util.concurrent.TimeUnit +package cats.tests +import cats.{Contravariant, Show} import cats.Show.ContravariantShow -import cats.laws.discipline.arbitrary._ +import cats.kernel.Order +import cats.instances.all._ +import cats.syntax.show._ import cats.laws.discipline.{ContravariantTests, MiniInt, SerializableTests} +import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ +import java.util.concurrent.TimeUnit import org.scalatest.funsuite.AnyFunSuiteLike - import scala.concurrent.duration.{Duration, FiniteDuration} class ShowSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/SortedMapSuite.scala b/tests/src/test/scala/cats/tests/SortedMapSuite.scala index f2703330ff..7eb46fc33c 100644 --- a/tests/src/test/scala/cats/tests/SortedMapSuite.scala +++ b/tests/src/test/scala/cats/tests/SortedMapSuite.scala @@ -1,7 +1,8 @@ -package cats -package tests +package cats.tests -import cats.kernel.CommutativeMonoid +import cats.{Align, FlatMap, MonoidK, Semigroupal, Show, Traverse, TraverseFilter} +import cats.instances.all._ +import cats.kernel.{CommutativeMonoid, Monoid} import cats.kernel.laws.discipline.{CommutativeMonoidTests, HashTests, MonoidTests} import cats.laws.discipline.{ AlignTests, @@ -12,9 +13,9 @@ import cats.laws.discipline.{ TraverseFilterTests, TraverseTests } -import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms - +import cats.laws.discipline.arbitrary._ +import cats.syntax.show._ import scala.collection.immutable.SortedMap class SortedMapSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/SortedSetSuite.scala b/tests/src/test/scala/cats/tests/SortedSetSuite.scala index 2708449af7..22dd36ce31 100644 --- a/tests/src/test/scala/cats/tests/SortedSetSuite.scala +++ b/tests/src/test/scala/cats/tests/SortedSetSuite.scala @@ -1,13 +1,15 @@ -package cats -package tests +package cats.tests +import cats.{SemigroupK, Semigroupal, Show} +import cats.instances.all._ +import cats.kernel.{Order, PartialOrder} import cats.kernel.laws.discipline.{BoundedSemilatticeTests, HashTests, OrderTests, PartialOrderTests} import cats.kernel.{BoundedSemilattice, Semilattice} import cats.laws._ import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline.arbitrary._ import cats.laws.discipline.{FoldableTests, SemigroupKTests, SemigroupalTests, SerializableTests} - +import cats.syntax.show._ import scala.collection.immutable.SortedSet class SortedSetSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/SplitSuite.scala b/tests/src/test/scala/cats/tests/SplitSuite.scala index 4aafcf5df3..7cb6bdec89 100644 --- a/tests/src/test/scala/cats/tests/SplitSuite.scala +++ b/tests/src/test/scala/cats/tests/SplitSuite.scala @@ -1,5 +1,7 @@ -package cats -package tests +package cats.tests + +import cats.instances.all._ +import cats.syntax.arrow._ class SplitSuite extends CatsSuite { test("syntax") { diff --git a/tests/src/test/scala/cats/tests/Spooky.scala b/tests/src/test/scala/cats/tests/Spooky.scala index cfbc12a3cc..bc1ce9d003 100644 --- a/tests/src/test/scala/cats/tests/Spooky.scala +++ b/tests/src/test/scala/cats/tests/Spooky.scala @@ -1,5 +1,4 @@ -package cats -package tests +package cats.tests /** * Class for spooky side-effects and action-at-a-distance. diff --git a/tests/src/test/scala/cats/tests/StreamSuite.scala b/tests/src/test/scala/cats/tests/StreamSuite.scala index ab4348c717..ff002c02ae 100644 --- a/tests/src/test/scala/cats/tests/StreamSuite.scala +++ b/tests/src/test/scala/cats/tests/StreamSuite.scala @@ -1,6 +1,8 @@ -package cats -package tests +package cats.tests +import cats.{Align, Alternative, CoflatMap, Monad, Semigroupal, Traverse, TraverseFilter} +import cats.data.ZipStream +import cats.instances.all._ import cats.laws.discipline.{ AlignTests, AlternativeTests, @@ -12,8 +14,8 @@ import cats.laws.discipline.{ TraverseFilterTests, TraverseTests } -import cats.data.ZipStream import cats.laws.discipline.arbitrary._ +import cats.syntax.show._ import org.scalatest.funsuite.AnyFunSuiteLike class StreamSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/SyntaxSuite.scala b/tests/src/test/scala/cats/tests/SyntaxSuite.scala index 136e0e11e2..9a4653958c 100644 --- a/tests/src/test/scala/cats/tests/SyntaxSuite.scala +++ b/tests/src/test/scala/cats/tests/SyntaxSuite.scala @@ -1,21 +1,11 @@ -package cats -package tests +package cats.tests -import scala.collection.immutable.SortedSet -import scala.collection.immutable.SortedMap +import cats._ import cats.arrow.Compose import cats.data.{Binested, Nested, NonEmptyChain, NonEmptyList, NonEmptySet} -import cats.instances.{ - AllInstances, - AllInstancesBinCompat0, - AllInstancesBinCompat1, - AllInstancesBinCompat2, - AllInstancesBinCompat3, - AllInstancesBinCompat4, - AllInstancesBinCompat5, - AllInstancesBinCompat6 -} -import cats.syntax.AllSyntaxBinCompat +import cats.instances.all._ +import cats.syntax.all._ +import scala.collection.immutable.{SortedMap, SortedSet} /** * Test that our syntax implicits are working. @@ -35,16 +25,7 @@ import cats.syntax.AllSyntaxBinCompat * * None of these tests should ever run, or do any runtime checks. */ -object SyntaxSuite - extends AllSyntaxBinCompat - with AllInstances - with AllInstancesBinCompat0 - with AllInstancesBinCompat1 - with AllInstancesBinCompat2 - with AllInstancesBinCompat3 - with AllInstancesBinCompat4 - with AllInstancesBinCompat5 - with AllInstancesBinCompat6 { +object SyntaxSuite { // pretend we have a value of type A def mock[A]: A = ??? diff --git a/tests/src/test/scala/cats/tests/TailRecSuite.scala b/tests/src/test/scala/cats/tests/TailRecSuite.scala index f6c9cafc13..506edacb77 100644 --- a/tests/src/test/scala/cats/tests/TailRecSuite.scala +++ b/tests/src/test/scala/cats/tests/TailRecSuite.scala @@ -1,12 +1,12 @@ -package cats -package tests +package cats.tests +import cats.{Defer, Monad} +import cats.instances.all._ +import cats.kernel.Eq +import cats.laws.discipline.{DeferTests, MonadTests, SerializableTests} import scala.util.control.TailCalls.{done, tailcall, TailRec} import org.scalacheck.{Arbitrary, Cogen, Gen} - -import Arbitrary.arbitrary - -import cats.laws.discipline.{DeferTests, MonadTests, SerializableTests} +import org.scalacheck.Arbitrary.arbitrary class TailRecSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/TraverseSuite.scala b/tests/src/test/scala/cats/tests/TraverseSuite.scala index 7dbeed6c6a..7014c6beb3 100644 --- a/tests/src/test/scala/cats/tests/TraverseSuite.scala +++ b/tests/src/test/scala/cats/tests/TraverseSuite.scala @@ -1,10 +1,12 @@ -package cats -package tests - -import org.scalacheck.Arbitrary +package cats.tests +import cats.{Applicative, Eval, Traverse} import cats.instances.all._ -import kernel.compat.scalaVersionSpecific._ +import cats.kernel.compat.scalaVersionSpecific._ +import cats.syntax.foldable._ +import cats.syntax.functor._ +import cats.syntax.traverse._ +import org.scalacheck.Arbitrary @suppressUnusedImportWarningForScalaVersionSpecific abstract class TraverseSuite[F[_]: Traverse](name: String)(implicit ArbFInt: Arbitrary[F[Int]]) extends CatsSuite { @@ -23,7 +25,7 @@ abstract class TraverseSuite[F[_]: Traverse](name: String)(implicit ArbFInt: Arb test(s"Traverse[$name].traverseWithIndexM") { forAll { (fa: F[Int], fn: ((Int, Int)) => (Int, Int)) => - val left = fa.traverseWithIndexM((a, i) => fn((a, i))).map(_.toList) + val left = fa.traverseWithIndexM((a, i) => fn((a, i))).fmap(_.toList) val (xs, values) = fa.toList.zipWithIndex.map(fn).unzip left should ===((xs.combineAll, values)) } diff --git a/tests/src/test/scala/cats/tests/TrySuite.scala b/tests/src/test/scala/cats/tests/TrySuite.scala index a63ab7e805..35c311d691 100644 --- a/tests/src/test/scala/cats/tests/TrySuite.scala +++ b/tests/src/test/scala/cats/tests/TrySuite.scala @@ -1,11 +1,14 @@ -package cats -package tests +package cats.tests +import cats.{CoflatMap, Eval, Later, Monad, MonadError, Semigroupal, Traverse} +import cats.instances.all._ +import cats.kernel.{Eq, Monoid, Semigroup} import cats.kernel.laws.discipline.{MonoidTests, SemigroupTests} import cats.laws.{ApplicativeLaws, CoflatMapLaws, FlatMapLaws, MonadLaws} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ - +import cats.syntax.apply._ +import cats.syntax.show._ import scala.util.{Success, Try} class TrySuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/Tuple2KSuite.scala b/tests/src/test/scala/cats/tests/Tuple2KSuite.scala index d13b86d821..4550382446 100644 --- a/tests/src/test/scala/cats/tests/Tuple2KSuite.scala +++ b/tests/src/test/scala/cats/tests/Tuple2KSuite.scala @@ -1,13 +1,13 @@ -package cats -package tests +package cats.tests +import cats._ import cats.data.{Const, Tuple2K, Validated} -import cats.Contravariant +import cats.instances.all._ +import cats.kernel.laws.discipline.{EqTests, OrderTests, PartialOrderTests} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ import cats.laws.discipline.SemigroupalTests.Isomorphisms -import cats.kernel.laws.discipline.{EqTests, OrderTests, PartialOrderTests} class Tuple2KSuite extends CatsSuite { implicit val iso: Isomorphisms[Tuple2K[Option, List, *]] = Isomorphisms.invariant[Tuple2K[Option, List, *]] diff --git a/tests/src/test/scala/cats/tests/TupleSuite.scala b/tests/src/test/scala/cats/tests/TupleSuite.scala index 73a1cae49b..9037408d69 100644 --- a/tests/src/test/scala/cats/tests/TupleSuite.scala +++ b/tests/src/test/scala/cats/tests/TupleSuite.scala @@ -1,12 +1,25 @@ -package cats -package tests - -import data.NonEmptyList - +package cats.tests + +import cats.{ + Bitraverse, + CommutativeFlatMap, + CommutativeMonad, + Comonad, + ContravariantSemigroupal, + FlatMap, + Monad, + Reducible, + Show, + Traverse +} +import cats.data.NonEmptyList +import cats.instances.all._ +import cats.kernel.{Eq, Order} import cats.laws.discipline._ import cats.laws.discipline.arbitrary._ import cats.laws.discipline.SemigroupalTests.Isomorphisms -import Helpers.CSemi +import cats.syntax.show._ +import cats.tests.Helpers.CSemi class TupleSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/UnorderedFoldableSuite.scala b/tests/src/test/scala/cats/tests/UnorderedFoldableSuite.scala index 4f8a4ab9d1..e50785e12f 100644 --- a/tests/src/test/scala/cats/tests/UnorderedFoldableSuite.scala +++ b/tests/src/test/scala/cats/tests/UnorderedFoldableSuite.scala @@ -1,10 +1,11 @@ -package cats -package tests +package cats.tests -import org.scalacheck.Arbitrary +import cats.UnorderedFoldable import cats.instances.all._ import cats.kernel.CommutativeMonoid import cats.laws.discipline.UnorderedFoldableTests +import cats.syntax.unorderedFoldable._ +import org.scalacheck.Arbitrary sealed abstract class UnorderedFoldableSuite[F[_]](name: String)(implicit ArbFString: Arbitrary[F[String]], ArbFInt: Arbitrary[F[Int]]) diff --git a/tests/src/test/scala/cats/tests/UnorderedTraverseSuite.scala b/tests/src/test/scala/cats/tests/UnorderedTraverseSuite.scala index eded204858..c30d0f8f8e 100644 --- a/tests/src/test/scala/cats/tests/UnorderedTraverseSuite.scala +++ b/tests/src/test/scala/cats/tests/UnorderedTraverseSuite.scala @@ -1,5 +1,8 @@ -package cats -package tests +package cats.tests + +import cats.Id +import cats.instances.all._ +import cats.syntax.unorderedTraverse._ class UnorderedTraverseSuite extends CatsSuite { test("UnorderedTraverse[Set[Int]].unorderedTraverse via syntax") { diff --git a/tests/src/test/scala/cats/tests/ValidatedSuite.scala b/tests/src/test/scala/cats/tests/ValidatedSuite.scala index 080a284483..2358b6597a 100644 --- a/tests/src/test/scala/cats/tests/ValidatedSuite.scala +++ b/tests/src/test/scala/cats/tests/ValidatedSuite.scala @@ -1,15 +1,29 @@ -package cats -package tests - -import cats.data._ +package cats.tests + +import cats.{ + Align, + Applicative, + ApplicativeError, + Bitraverse, + CommutativeApplicative, + SemigroupK, + Semigroupal, + Show, + Traverse +} +import cats.data.{EitherT, Ior, NonEmptyChain, NonEmptyList, Validated, ValidatedNel} import cats.data.Validated.{Invalid, Valid} +import cats.instances.all._ +import cats.kernel.{Eq, Order, PartialOrder, Semigroup} +import cats.kernel.laws.discipline.{EqTests, MonoidTests, OrderTests, PartialOrderTests, SemigroupTests} import cats.laws.discipline._ -import org.scalacheck.Arbitrary._ import cats.laws.discipline.SemigroupKTests import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline.arbitrary._ -import cats.kernel.laws.discipline.{EqTests, MonoidTests, OrderTests, PartialOrderTests, SemigroupTests} - +import cats.syntax.apply._ +import cats.syntax.either._ +import cats.syntax.validated._ +import org.scalacheck.Arbitrary._ import scala.util.Try class ValidatedSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/VectorSuite.scala b/tests/src/test/scala/cats/tests/VectorSuite.scala index c5d96603b2..cc9e41577a 100644 --- a/tests/src/test/scala/cats/tests/VectorSuite.scala +++ b/tests/src/test/scala/cats/tests/VectorSuite.scala @@ -1,7 +1,8 @@ -package cats -package tests +package cats.tests +import cats.{Align, Alternative, CoflatMap, Monad, Semigroupal, Traverse, TraverseFilter} import cats.data.{NonEmptyVector, ZipVector} +import cats.instances.all._ import cats.laws.discipline.{ AlignTests, AlternativeTests, @@ -14,6 +15,8 @@ import cats.laws.discipline.{ TraverseTests } import cats.laws.discipline.arbitrary._ +import cats.syntax.show._ +import cats.syntax.vector._ import org.scalatest.funsuite.AnyFunSuiteLike class VectorSuite extends CatsSuite { diff --git a/tests/src/test/scala/cats/tests/WordCountSuite.scala b/tests/src/test/scala/cats/tests/WordCountSuite.scala index 781447cc25..f10be2d46a 100644 --- a/tests/src/test/scala/cats/tests/WordCountSuite.scala +++ b/tests/src/test/scala/cats/tests/WordCountSuite.scala @@ -1,8 +1,8 @@ -package cats -package tests +package cats.tests -import cats.data.{AppFunc, Const, Func} -import Func.appFunc +import cats.data.{AppFunc, Const} +import cats.data.Func.appFunc +import cats.instances.all._ /* * This an example of applicative function composition. diff --git a/tests/src/test/scala/cats/tests/WriterSuite.scala b/tests/src/test/scala/cats/tests/WriterSuite.scala index 1c9e4a7d91..6120f51f85 100644 --- a/tests/src/test/scala/cats/tests/WriterSuite.scala +++ b/tests/src/test/scala/cats/tests/WriterSuite.scala @@ -1,7 +1,9 @@ -package cats -package tests +package cats.tests import cats.data.Writer +import cats.instances.all._ +import cats.syntax.applicative._ +import cats.syntax.writer._ class WriterSuite extends CatsSuite { test("pure syntax creates a writer with an empty log") { diff --git a/tests/src/test/scala/cats/tests/WriterTSuite.scala b/tests/src/test/scala/cats/tests/WriterTSuite.scala index 815a4b7180..dcf1a0e477 100644 --- a/tests/src/test/scala/cats/tests/WriterTSuite.scala +++ b/tests/src/test/scala/cats/tests/WriterTSuite.scala @@ -1,13 +1,14 @@ -package cats -package tests +package cats.tests +import cats._ import cats.data.{Const, EitherT, Validated, Writer, WriterT} -import cats.kernel.Semigroup +import cats.instances.all._ +import cats.kernel.laws.discipline.{EqTests, MonoidTests, SemigroupTests} import cats.laws.discipline._ +import cats.laws.discipline.SemigroupalTests.Isomorphisms import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ -import cats.laws.discipline.SemigroupalTests.Isomorphisms -import cats.kernel.laws.discipline.{EqTests, MonoidTests, SemigroupTests} +import cats.syntax.option._ class WriterTSuite extends CatsSuite { type Logged[A] = Writer[ListWrapper[Int], A]