From 4acff5698a0a6d3bdfecb5ece6206294a7a06206 Mon Sep 17 00:00:00 2001 From: yilinwei Date: Fri, 26 May 2017 20:16:08 +0100 Subject: [PATCH] Adding implicit resolution tests for piecemeal imports for hierarchy --- tests/src/test/scala/cats/tests/EqTests.scala | 24 +++++++++++++++++++ .../test/scala/cats/tests/MonoidTests.scala | 22 +++++++++++++++++ .../test/scala/cats/tests/OrderTests.scala | 20 ++++++++++++++++ .../scala/cats/tests/PartialOrderTests.scala | 20 ++++++++++++++++ .../scala/cats/tests/SemigroupTests.scala | 22 +++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 tests/src/test/scala/cats/tests/EqTests.scala create mode 100644 tests/src/test/scala/cats/tests/MonoidTests.scala create mode 100644 tests/src/test/scala/cats/tests/OrderTests.scala create mode 100644 tests/src/test/scala/cats/tests/PartialOrderTests.scala create mode 100644 tests/src/test/scala/cats/tests/SemigroupTests.scala diff --git a/tests/src/test/scala/cats/tests/EqTests.scala b/tests/src/test/scala/cats/tests/EqTests.scala new file mode 100644 index 0000000000..bff1605484 --- /dev/null +++ b/tests/src/test/scala/cats/tests/EqTests.scala @@ -0,0 +1,24 @@ +package cats +package tests + +import org.scalatest._ + +import cats.functor._ + +class EqTests extends FunSuite { + { + import cats.implicits._ + implicitly[Invariant[Eq]] + implicitly[Contravariant[Eq]] + implicitly[Cartesian[Eq]] + implicitly[ContravariantCartesian[Eq]] + } + + { + import cats.instances.eq._ + implicitly[Invariant[Eq]] + implicitly[Contravariant[Eq]] + implicitly[Cartesian[Eq]] + implicitly[ContravariantCartesian[Eq]] + } +} diff --git a/tests/src/test/scala/cats/tests/MonoidTests.scala b/tests/src/test/scala/cats/tests/MonoidTests.scala new file mode 100644 index 0000000000..75fb72b8d1 --- /dev/null +++ b/tests/src/test/scala/cats/tests/MonoidTests.scala @@ -0,0 +1,22 @@ +package cats +package tests + +import org.scalatest._ + +import cats.functor._ + +class MonoidTests extends FunSuite { + { + import cats.implicits._ + implicitly[Invariant[Monoid]] + implicitly[Cartesian[Monoid]] + implicitly[InvariantMonoidal[Monoid]] + } + + { + import cats.instances.monoid._ + implicitly[Invariant[Monoid]] + implicitly[Cartesian[Monoid]] + implicitly[InvariantMonoidal[Monoid]] + } +} diff --git a/tests/src/test/scala/cats/tests/OrderTests.scala b/tests/src/test/scala/cats/tests/OrderTests.scala new file mode 100644 index 0000000000..8a8e2d65ef --- /dev/null +++ b/tests/src/test/scala/cats/tests/OrderTests.scala @@ -0,0 +1,20 @@ +package cats +package tests + +import cats.functor._ + +import org.scalatest._ + +class OrderTests extends FunSuite { + { + import cats.implicits._ + implicitly[Invariant[Order]] + implicitly[Contravariant[Order]] + } + + { + import cats.instances.order._ + implicitly[Invariant[Order]] + implicitly[Contravariant[Order]] + } +} diff --git a/tests/src/test/scala/cats/tests/PartialOrderTests.scala b/tests/src/test/scala/cats/tests/PartialOrderTests.scala new file mode 100644 index 0000000000..b5393ca27a --- /dev/null +++ b/tests/src/test/scala/cats/tests/PartialOrderTests.scala @@ -0,0 +1,20 @@ +package cats +package tests + +import org.scalatest._ + +import cats.functor._ + +class PartialOrderTests extends FunSuite { + { + import cats.implicits._ + implicitly[Invariant[PartialOrder]] + implicitly[Contravariant[PartialOrder]] + } + + { + import cats.instances.partialOrder._ + implicitly[Invariant[PartialOrder]] + implicitly[Contravariant[PartialOrder]] + } +} diff --git a/tests/src/test/scala/cats/tests/SemigroupTests.scala b/tests/src/test/scala/cats/tests/SemigroupTests.scala new file mode 100644 index 0000000000..083996f127 --- /dev/null +++ b/tests/src/test/scala/cats/tests/SemigroupTests.scala @@ -0,0 +1,22 @@ +package cats +package tests + +import org.scalatest._ + +import cats.functor._ + +class SemigroupTests extends FunSuite { + { + import cats.implicits._ + implicitly[Invariant[Semigroup]] + implicitly[Cartesian[Semigroup]] + implicitly[InvariantMonoidal[Semigroup]] + } + + { + import cats.instances.semigroup._ + implicitly[Invariant[Semigroup]] + implicitly[Cartesian[Semigroup]] + implicitly[InvariantMonoidal[Semigroup]] + } +}