Skip to content

Commit

Permalink
Some Dotty compat for tests (#3253)
Browse files Browse the repository at this point in the history
* Add some parentheses for Dotty

* Add type annotations for Dotty

* Fix unused imports in cats-free

* Fix tests on 2.13
  • Loading branch information
travisbrown authored Jan 13, 2020
1 parent 2023db1 commit 8d4ee36
Show file tree
Hide file tree
Showing 56 changed files with 339 additions and 271 deletions.
9 changes: 5 additions & 4 deletions free/src/test/scala/cats/free/CofreeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package cats
package free

import cats.data.{NonEmptyList, OptionT}
import cats.laws.discipline.{ComonadTests, ReducibleTests, SemigroupalTests, SerializableTests, TraverseTests}
import cats.laws.discipline.{ComonadTests, ReducibleTests, SerializableTests, TraverseTests}
import cats.laws.discipline.SemigroupalTests.Isomorphisms
import cats.syntax.list._
import cats.tests.{CatsSuite, Spooky}
import org.scalacheck.{Arbitrary, Cogen, Gen}
Expand All @@ -11,16 +12,16 @@ class CofreeSuite extends CatsSuite {

import CofreeSuite._

implicit val iso = SemigroupalTests.Isomorphisms.invariant[Cofree[Option, *]]
implicit val iso: Isomorphisms[Cofree[Option, *]] = Isomorphisms.invariant[Cofree[Option, *]]

checkAll("Cofree[Option, *]", ComonadTests[Cofree[Option, *]].comonad[Int, Int, Int])
locally {
implicit val instance = Cofree.catsTraverseForCofree[Option]
implicit val instance: Traverse[Cofree[Option, *]] = Cofree.catsTraverseForCofree[Option]
checkAll("Cofree[Option, *]", TraverseTests[Cofree[Option, *]].traverse[Int, Int, Int, Int, Option, Option])
checkAll("Traverse[Cofree[Option, *]]", SerializableTests.serializable(Traverse[Cofree[Option, *]]))
}
locally {
implicit val instance = Cofree.catsReducibleForCofree[Option]
implicit val instance: Reducible[Cofree[Option, *]] = Cofree.catsReducibleForCofree[Option]
checkAll("Cofree[Option, *]", ReducibleTests[Cofree[Option, *]].reducible[Option, Int, Int])
checkAll("Reducible[Cofree[Option, *]]", SerializableTests.serializable(Reducible[Cofree[Option, *]]))
}
Expand Down
5 changes: 3 additions & 2 deletions free/src/test/scala/cats/free/FreeApplicativeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ package free

import cats.tests.CatsSuite
import cats.arrow.FunctionK
import cats.laws.discipline.{ApplicativeTests, SemigroupalTests, SerializableTests}
import cats.laws.discipline.{ApplicativeTests, SerializableTests}
import cats.laws.discipline.SemigroupalTests.Isomorphisms
import cats.data.State

import org.scalacheck.{Arbitrary, Gen}

class FreeApplicativeSuite extends CatsSuite {
import FreeApplicativeSuite._

implicit val iso = SemigroupalTests.Isomorphisms.invariant[FreeApplicative[Option, *]]
implicit val iso: Isomorphisms[FreeApplicative[Option, *]] = Isomorphisms.invariant[FreeApplicative[Option, *]]

checkAll("FreeApplicative[Option, *]", ApplicativeTests[FreeApplicative[Option, *]].applicative[Int, Int, Int])
checkAll("Applicative[FreeApplicative[Option, *]]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class FreeInvariantMonoidalSuite extends CatsSuite {
}
}

implicit val isoFreeBinCodec = Isomorphisms.invariant[FreeInvariantMonoidal[BinCodec, *]]
implicit val isoFreeBinCodec: Isomorphisms[FreeInvariantMonoidal[BinCodec, *]] =
Isomorphisms.invariant[FreeInvariantMonoidal[BinCodec, *]]

checkAll("FreeInvariantMonoidal[BinCodec, *]",
InvariantMonoidalTests[FreeInvariantMonoidal[BinCodec, *]].invariantMonoidal[MiniInt, Boolean, Boolean])
Expand Down
9 changes: 5 additions & 4 deletions free/src/test/scala/cats/free/FreeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package free

import cats.arrow.FunctionK
import cats.data.EitherK
import cats.laws.discipline.{DeferTests, FoldableTests, MonadTests, SemigroupalTests, SerializableTests, TraverseTests}
import cats.laws.discipline.{DeferTests, FoldableTests, MonadTests, SerializableTests, TraverseTests}
import cats.laws.discipline.arbitrary.catsLawsArbitraryForFn0
import cats.laws.discipline.SemigroupalTests.Isomorphisms
import cats.tests.CatsSuite

import org.scalacheck.{Arbitrary, Cogen, Gen}
Expand All @@ -13,7 +14,7 @@ import Arbitrary.arbFunction1
class FreeSuite extends CatsSuite {
import FreeSuite._

implicit val iso = SemigroupalTests.Isomorphisms.invariant[Free[Option, *]]
implicit val iso: Isomorphisms[Free[Option, *]] = Isomorphisms.invariant[Free[Option, *]]

Monad[Free[Id, *]]
implicitly[Monad[Free[Id, *]]]
Expand All @@ -27,14 +28,14 @@ class FreeSuite extends CatsSuite {
checkAll("Monad[Free[Option, *]]", SerializableTests.serializable(Monad[Free[Option, *]]))

locally {
implicit val instance = Free.catsFreeFoldableForFree[Option]
implicit val instance: Foldable[Free[Option, *]] = Free.catsFreeFoldableForFree[Option]

checkAll("Free[Option, *]", FoldableTests[Free[Option, *]].foldable[Int, Int])
checkAll("Foldable[Free[Option,*]]", SerializableTests.serializable(Foldable[Free[Option, *]]))
}

locally {
implicit val instance = Free.catsFreeTraverseForFree[Option]
implicit val instance: Traverse[Free[Option, *]] = Free.catsFreeTraverseForFree[Option]
checkAll("Free[Option,*]", TraverseTests[Free[Option, *]].traverse[Int, Int, Int, Int, Option, Option])
checkAll("Traverse[Free[Option,*]]", SerializableTests.serializable(Traverse[Free[Option, *]]))
}
Expand Down
2 changes: 1 addition & 1 deletion jvm/src/test/scala/cats/tests/FutureSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FutureSuite extends CatsSuite {
checkAll("Future", CoflatMapTests[Future].coflatMap[Int, Int, Int])

{
implicit val F = ListWrapper.semigroup[Int]
implicit val F: Semigroup[ListWrapper[Int]] = ListWrapper.semigroup[Int]
checkAll("Future[ListWrapper[Int]]", SemigroupLawTests[Future[ListWrapper[Int]]].semigroup)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class Tests extends AnyFunSuiteLike with Discipline with ScalaVersionSpecificTes
.forall { case (x, y) => a.eqv(x, y) == b.eqv(x, y) }
}

implicit val monoidOrderN = Order.whenEqualMonoid[N]
implicit val monoidOrderN: Monoid[Order[N]] with Band[Order[N]] = Order.whenEqualMonoid[N]
checkAll("Monoid[Order[N]]", MonoidTests[Order[N]].monoid)
checkAll("Band[Order[N]]", BandTests[Order[N]].band)

Expand Down
2 changes: 1 addition & 1 deletion laws/src/main/scala/cats/laws/NonEmptyTraverseLaws.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ trait NonEmptyTraverseLaws[F[_]] extends TraverseLaws[F] with ReducibleLaws[F] {
N: Apply[N],
M: Apply[M]): IsEq[(M[F[B]], N[F[B]])] = {
type MN[Z] = (M[Z], N[Z])
implicit val MN = new Apply[MN] {
implicit val MN: Apply[MN] = new Apply[MN] {
def ap[X, Y](f: MN[X => Y])(fa: MN[X]): MN[Y] = {
val (fam, fan) = fa
val (fm, fn) = f
Expand Down
4 changes: 2 additions & 2 deletions laws/src/main/scala/cats/laws/TraverseLaws.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ trait TraverseLaws[F[_]] extends FunctorLaws[F] with FoldableLaws[F] with Unorde
N: Applicative[N],
M: Applicative[M]): IsEq[(M[F[B]], N[F[B]])] = {
type MN[Z] = (M[Z], N[Z])
implicit val MN = new Applicative[MN] {
implicit val MN: Applicative[MN] = new Applicative[MN] {
def pure[X](x: X): MN[X] = (M.pure(x), N.pure(x))
def ap[X, Y](f: MN[X => Y])(fa: MN[X]): MN[Y] = {
val (fam, fan) = fa
Expand Down Expand Up @@ -67,7 +67,7 @@ trait TraverseLaws[F[_]] extends FunctorLaws[F] with FoldableLaws[F] with Unorde
def traverseOrderConsistent[A](fa: F[A]): IsEq[Option[A]] = {
class FirstOption[T](val o: Option[T])

implicit val firstOptionMonoid = new Monoid[FirstOption[A]] {
implicit val firstOptionMonoid: Monoid[FirstOption[A]] = new Monoid[FirstOption[A]] {
def empty = new FirstOption(None)
def combine(x: FirstOption[A], y: FirstOption[A]) = new FirstOption(x.o.orElse(y.o))
}
Expand Down
2 changes: 1 addition & 1 deletion laws/src/main/scala/cats/laws/UnorderedTraverseLaws.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ trait UnorderedTraverseLaws[F[_]] extends UnorderedFoldableLaws[F] {
): IsEq[(M[F[B]], N[F[B]])] = {

type MN[Z] = (M[Z], N[Z])
implicit val MN = new CommutativeApplicative[MN] {
implicit val MN: CommutativeApplicative[MN] = new CommutativeApplicative[MN] {
def pure[X](x: X): MN[X] = (M.pure(x), N.pure(x))
def ap[X, Y](f: MN[X => Y])(fa: MN[X]): MN[Y] = {
val (fam, fan) = fa
Expand Down
2 changes: 1 addition & 1 deletion testkit/src/main/scala/cats/tests/ListWrapper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.scalacheck.Arbitrary.arbitrary
*
* {{{
* {
* implicit val functor = ListWrapper.functor
* implicit val functor: Functor[ListWrapper] = ListWrapper.functor
* checkAll(..., ...)
* }
* }}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import cats.data.{NonEmptyStream, OneAnd}
import cats.instances.stream._
import cats.kernel.laws.discipline.{EqTests, SemigroupTests}
import cats.laws.discipline.arbitrary._
import cats.laws.discipline.SemigroupalTests.Isomorphisms
import cats.laws.discipline._

class NonEmptyStreamSuite extends CatsSuite {
Expand All @@ -31,7 +32,7 @@ class NonEmptyStreamSuite extends CatsSuite {
implicitly[Comonad[NonEmptyStream]]
}

implicit val iso2 = SemigroupalTests.Isomorphisms.invariant[NonEmptyStream]
implicit val iso2: Isomorphisms[NonEmptyStream] = Isomorphisms.invariant[NonEmptyStream]

checkAll("NonEmptyStream[Int]", MonadTests[NonEmptyStream].monad[Int, Int, Int])
checkAll("Monad[NonEmptyStream[A]]", SerializableTests.serializable(Monad[NonEmptyStream]))
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/scala-2.13+/cats/tests/LazyListSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class LazyListSuite extends CatsSuite {
}

test("Show[LazyList] is referentially transparent, unlike LazyList.toString") {
forAll { lazyList: LazyList[Int] =>
forAll { (lazyList: LazyList[Int]) =>
if (!lazyList.isEmpty) {
val unevaluatedLL = lazyList.map(identity)
val initialShow = unevaluatedLL.show
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class NonEmptyLazyListSuite extends CatsSuite {
checkAll("Show[NonEmptyLazyList[Int]]", SerializableTests.serializable(Show[NonEmptyLazyList[Int]]))

{
implicit val partialOrder = ListWrapper.partialOrder[Int]
implicit val partialOrder: PartialOrder[ListWrapper[Int]] = ListWrapper.partialOrder[Int]
checkAll("NonEmptyLazyList[ListWrapper[Int]]", PartialOrderTests[NonEmptyLazyList[ListWrapper[Int]]].partialOrder)
checkAll("PartialOrder[NonEmptyLazyList[ListWrapper[Int]]",
SerializableTests.serializable(PartialOrder[NonEmptyLazyList[ListWrapper[Int]]]))
}

{
implicit val eqv = ListWrapper.eqv[Int]
implicit val eqv: Eq[ListWrapper[Int]] = ListWrapper.eqv[Int]
checkAll("NonEmptyLazyList[ListWrapper[Int]]", EqTests[NonEmptyLazyList[ListWrapper[Int]]].eqv)
checkAll("Eq[NonEmptyLazyList[ListWrapper[Int]]",
SerializableTests.serializable(Eq[NonEmptyLazyList[ListWrapper[Int]]]))
Expand Down Expand Up @@ -126,7 +126,7 @@ class NonEmptyLazyListSuite extends CatsSuite {
}

test("NonEmptyLazyList#distinct is consistent with List#distinct") {
forAll { ci: NonEmptyLazyList[Int] =>
forAll { (ci: NonEmptyLazyList[Int]) =>
ci.distinct.toList should ===(ci.toList.distinct)
}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ trait ScalaVersionSpecificFoldableSuite { self: FoldableSuiteAdditional =>
dangerous.foldM(0)((acc, a) => if (a < 2) Some(acc + a) else None) should ===(None)
}

def foldableLazyListWithDefaultImpl = new Foldable[LazyList] {
def foldableLazyListWithDefaultImpl: Foldable[LazyList] = new Foldable[LazyList] {
def foldLeft[A, B](fa: LazyList[A], b: B)(f: (B, A) => B): B =
Foldable[LazyList].foldLeft(fa, b)(f)

Expand All @@ -57,7 +57,7 @@ trait ScalaVersionSpecificFoldableSuite { self: FoldableSuiteAdditional =>
}

test("Foldable[LazyList].foldLeftM short-circuiting") {
implicit val F = foldableLazyListWithDefaultImpl
implicit val F: Foldable[LazyList] = foldableLazyListWithDefaultImpl
val ns = LazyList.continually(1)
val res = F.foldLeftM[Either[Int, *], Int, Int](ns, 0) { (sum, n) =>
if (sum >= 100000) Left(sum) else Right(sum + n)
Expand All @@ -66,7 +66,7 @@ trait ScalaVersionSpecificFoldableSuite { self: FoldableSuiteAdditional =>
}

test("Foldable[LazyList].foldLeftM short-circuiting optimality") {
implicit val F = foldableLazyListWithDefaultImpl
implicit val F: Foldable[LazyList] = foldableLazyListWithDefaultImpl

// test that no more elements are evaluated than absolutely necessary

Expand All @@ -81,13 +81,13 @@ trait ScalaVersionSpecificFoldableSuite { self: FoldableSuiteAdditional =>
}

test("Foldable[LazyList].existsM/.forallM short-circuiting") {
implicit val F = foldableLazyListWithDefaultImpl
implicit val F: Foldable[LazyList] = foldableLazyListWithDefaultImpl
assert(F.existsM[Id, Boolean](true #:: boomLazyList[Boolean])(identity) == true)
assert(F.forallM[Id, Boolean](false #:: boomLazyList[Boolean])(identity) == false)
}

test("Foldable[LazyList].findM/.collectFirstSomeM short-circuiting") {
implicit val F = foldableLazyListWithDefaultImpl
implicit val F: Foldable[LazyList] = foldableLazyListWithDefaultImpl
assert((1 #:: boomLazyList[Int]).findM[Id](_ > 0) == Some(1))
assert((1 #:: boomLazyList[Int]).collectFirstSomeM[Id, Int](Option.apply) == Some(1))
}
Expand Down
3 changes: 2 additions & 1 deletion tests/src/test/scala/cats/tests/AndThenSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class AndThenSuite extends CatsSuite {
checkAll("Semigroupal[AndThen[Int, *]]", SerializableTests.serializable(Semigroupal[AndThen[Int, *]]))

{
implicit val iso = SemigroupalTests.Isomorphisms.invariant[AndThen[*, Int]]
implicit val iso: SemigroupalTests.Isomorphisms[AndThen[*, Int]] =
SemigroupalTests.Isomorphisms.invariant[AndThen[*, Int]]
checkAll("AndThen[*, Int]",
ContravariantMonoidalTests[AndThen[*, Int]].contravariantMonoidal[MiniInt, Boolean, Boolean])
checkAll("ContravariantMonoidal[AndThen[*, Int]]",
Expand Down
16 changes: 8 additions & 8 deletions tests/src/test/scala/cats/tests/ApplicativeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ApplicativeSuite extends CatsSuite {
}

{
implicit val optionMonoid = Applicative.monoid[Option, Int]
implicit val optionMonoid: Monoid[Option[Int]] = Applicative.monoid[Option, Int]
checkAll("Applicative[Option].monoid", MonoidTests[Option[Int]](optionMonoid).monoid)
}

Expand All @@ -51,23 +51,23 @@ class ApplicativeSuite extends CatsSuite {
}

{
implicit val listwrapperApplicative = ListWrapper.applicative
implicit val listwrapperCoflatMap = Applicative.coflatMap[ListWrapper]
implicit val listwrapperApplicative: Applicative[ListWrapper] = ListWrapper.applicative
implicit val listwrapperCoflatMap: CoflatMap[ListWrapper] = Applicative.coflatMap[ListWrapper]
checkAll("Applicative[ListWrapper].coflatMap", CoflatMapTests[ListWrapper].coflatMap[String, String, String])

implicit val validatedCoflatMap = Applicative.coflatMap[Validated[String, *]]
implicit val validatedCoflatMap: CoflatMap[Validated[String, *]] = Applicative.coflatMap[Validated[String, *]]
checkAll("Applicative[Validated].coflatMap", CoflatMapTests[Validated[String, *]].coflatMap[String, String, String])

implicit val constCoflatMap = Applicative.coflatMap[Const[String, *]]
implicit val constCoflatMap: CoflatMap[Const[String, *]] = Applicative.coflatMap[Const[String, *]]
checkAll("Applicative[Const].coflatMap", CoflatMapTests[Const[String, *]].coflatMap[String, String, String])

implicit val listwrapperAlign = Apply.align[ListWrapper]
implicit val listwrapperAlign: Align[ListWrapper] = Apply.align[ListWrapper]
checkAll("Apply[ListWrapper].align", AlignTests[ListWrapper].align[Int, Int, Int, Int])

implicit val validatedAlign = Apply.align[Validated[String, *]]
implicit val validatedAlign: Align[Validated[String, *]] = Apply.align[Validated[String, *]]
checkAll("Apply[Validated].align", AlignTests[Validated[String, *]].align[Int, Int, Int, Int])

implicit val constAlign = Apply.align[Const[String, *]]
implicit val constAlign: Align[Const[String, *]] = Apply.align[Const[String, *]]
checkAll("Apply[Const].align", AlignTests[Const[String, *]].align[Int, Int, Int, Int])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ class BinCodecInvariantMonoidalSuite extends CatsSuite {

{
implicit val miniIntMonoid: Monoid[MiniInt] = MiniInt.miniIntAddition
implicit val binMonoid = InvariantMonoidal.monoid[BinCodec, MiniInt]
implicit val binMonoid: Monoid[BinCodec[MiniInt]] = InvariantMonoidal.monoid[BinCodec, MiniInt]
checkAll("InvariantMonoidal[BinCodec].monoid", MonoidTests[BinCodec[MiniInt]].monoid)
}

{
implicit val miniIntSemigroup: Semigroup[MiniInt] = MiniInt.miniIntAddition
implicit val binSemigroup = InvariantSemigroupal.semigroup[BinCodec, MiniInt]
implicit val binSemigroup: Semigroup[BinCodec[MiniInt]] = InvariantSemigroupal.semigroup[BinCodec, MiniInt]
checkAll("InvariantSemigroupal[BinCodec].semigroup", SemigroupTests[BinCodec[MiniInt]].semigroup)
}
}
8 changes: 4 additions & 4 deletions tests/src/test/scala/cats/tests/BinestedSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BinestedSuite extends CatsSuite {

{
// Bifunctor + Functor + Functor = Bifunctor
implicit val instance = ListWrapper.functor
implicit val instance: Functor[ListWrapper] = ListWrapper.functor
checkAll(
"Binested[Either, ListWrapper, Option, *, *]",
BifunctorTests[Binested[Either, ListWrapper, Option, *, *]].bifunctor[Int, Int, Int, String, String, String]
Expand All @@ -28,7 +28,7 @@ class BinestedSuite extends CatsSuite {

{
// Profunctor + Functor + Functor = Profunctor
implicit val instance = OptionWrapper.functor
implicit val instance: Functor[OptionWrapper] = OptionWrapper.functor
Eq[OptionWrapper[MiniInt] => Option[Int]]
checkAll(
"Binested[Function1, OptionWrapper, Option, *, *]",
Expand All @@ -43,7 +43,7 @@ class BinestedSuite extends CatsSuite {

{
// Bifoldable + foldable + foldable = Bifoldable
implicit val instance = ListWrapper.foldable
implicit val instance: Foldable[ListWrapper] = ListWrapper.foldable
checkAll("Binested[Either, ListWrapper, ListWrapper, *, *]",
BifoldableTests[Binested[Either, ListWrapper, ListWrapper, *, *]].bifoldable[Int, Int, Int])
checkAll(
Expand All @@ -54,7 +54,7 @@ class BinestedSuite extends CatsSuite {

{
// Bitraverse + traverse + traverse = Bitraverse
implicit val instance = ListWrapper.traverse
implicit val instance: Traverse[ListWrapper] = ListWrapper.traverse
checkAll(
"Binested[Either, ListWrapper, ListWrapper, *, *]",
BitraverseTests[Binested[Either, ListWrapper, ListWrapper, *, *]]
Expand Down
6 changes: 3 additions & 3 deletions tests/src/test/scala/cats/tests/ChainSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ class ChainSuite extends CatsSuite {
checkAll("TraverseFilter[Chain]", SerializableTests.serializable(TraverseFilter[Chain]))

{
implicit val partialOrder = ListWrapper.partialOrder[Int]
implicit val partialOrder: PartialOrder[ListWrapper[Int]] = ListWrapper.partialOrder[Int]
checkAll("Chain[ListWrapper[Int]]", PartialOrderTests[Chain[ListWrapper[Int]]].partialOrder)
checkAll("PartialOrder[Chain[ListWrapper[Int]]",
SerializableTests.serializable(PartialOrder[Chain[ListWrapper[Int]]]))
}

{
implicit val eqv = ListWrapper.eqv[Int]
implicit val eqv: Eq[ListWrapper[Int]] = ListWrapper.eqv[Int]
checkAll("Chain[ListWrapper[Int]]", EqTests[Chain[ListWrapper[Int]]].eqv)
checkAll("Eq[Chain[ListWrapper[Int]]", SerializableTests.serializable(Eq[Chain[ListWrapper[Int]]]))
}

{
implicit val hash = ListWrapper.hash[Int]
implicit val hash: Hash[ListWrapper[Int]] = ListWrapper.hash[Int]
checkAll("Chain[ListWrapper[Int]]", HashTests[Chain[ListWrapper[Int]]].hash)
checkAll("Hash[Chain[ListWrapper[Int]]", SerializableTests.serializable(Hash[Chain[ListWrapper[Int]]]))
}
Expand Down
3 changes: 2 additions & 1 deletion tests/src/test/scala/cats/tests/CokleisliSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import cats.data.{Cokleisli, NonEmptyList}
import cats.laws.discipline._
import cats.laws.discipline.arbitrary._
import cats.laws.discipline.eq._
import cats.laws.discipline.SemigroupalTests.Isomorphisms

class CokleisliSuite extends SlowCatsSuite {

Expand All @@ -17,7 +18,7 @@ class CokleisliSuite extends SlowCatsSuite {
implicit def cokleisliEq[F[_], A, B](implicit ev: Eq[F[A] => B]): Eq[Cokleisli[F, A, B]] =
Eq.by[Cokleisli[F, A, B], F[A] => B](_.run)

implicit val iso = SemigroupalTests.Isomorphisms.invariant[Cokleisli[Option, Int, *]]
implicit val iso: Isomorphisms[Cokleisli[Option, Int, *]] = Isomorphisms.invariant[Cokleisli[Option, Int, *]]

checkAll("Cokleisli[Option, MiniInt, Int]",
SemigroupalTests[Cokleisli[Option, MiniInt, *]].semigroupal[Int, Int, Int])
Expand Down
Loading

0 comments on commit 8d4ee36

Please sign in to comment.