Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some bikeshedding and cleanup in tests #2199

Merged
merged 4 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions laws/shared/src/test/scala/cats/effect/laws/ClockSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ package laws

import cats.data.ContT
import cats.effect.kernel.testkit.freeEval, freeEval._

import org.specs2.ScalaCheck
import org.specs2.mutable.Specification

import org.typelevel.discipline.specs2.mutable.Discipline

class ClockSpec extends Specification with Discipline with ScalaCheck with BaseSpec {
class ClockSpec extends Specification with Discipline with BaseSpec {

// we only need to test the ones that *aren't* also Sync
checkAll("ContT[FreeEitherSync, Int, *]", ClockTests[ContT[FreeEitherSync, Int, *]].clock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ import cats.free.FreeT
import cats.laws.discipline.arbitrary._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class EitherTFreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityImplicits {
import FreeSyncGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ package cats.effect
package laws

import cats.data.EitherT
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._,
TimeT._
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._
import cats.effect.kernel.testkit.TimeT._
import cats.laws.discipline.arbitrary._

import org.scalacheck.Prop

import org.specs2.ScalaCheck
import org.specs2.mutable._
import org.typelevel.discipline.specs2.mutable.Discipline

import scala.concurrent.duration._

import org.typelevel.discipline.specs2.mutable.Discipline

class EitherTPureConcSpec extends Specification with Discipline with ScalaCheck with BaseSpec {
class EitherTPureConcSpec extends Specification with Discipline with BaseSpec {
import PureConcGenerators._
import OutcomeGenerators._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ import cats.effect.kernel.testkit.{freeEval, FreeSyncEq, FreeSyncGenerators, Syn
import cats.free.FreeT
import cats.laws.discipline.arbitrary._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class FreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityImplicits {
import FreeSyncGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ import cats.effect.kernel.testkit.{freeEval, FreeSyncGenerators, SyncTypeGenerat
import cats.free.FreeT
import cats.laws.discipline.arbitrary._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class IorTFreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityImplicits {
import FreeSyncGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ package cats.effect
package laws

import cats.data.IorT
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._,
TimeT._
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._
import cats.effect.kernel.testkit.TimeT._
import cats.laws.discipline.arbitrary._

import org.scalacheck.Prop

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

import scala.concurrent.duration._

class IorTPureConcSpec extends Specification with Discipline with ScalaCheck with BaseSpec {
class IorTPureConcSpec extends Specification with Discipline with BaseSpec {
import PureConcGenerators._
import OutcomeGenerators._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ import cats.effect.kernel.testkit.{freeEval, FreeSyncGenerators, SyncTypeGenerat
import cats.free.FreeT
import cats.laws.discipline.{arbitrary, eq, MiniInt}, arbitrary._, eq._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class KleisliFreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityImplicits {
import FreeSyncGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,20 @@ package laws
import cats.Order
import cats.data.Kleisli
import cats.effect.kernel.Outcome
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, Time, TimeT},
pure._, TimeT._
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, Time, TimeT}
import cats.effect.kernel.testkit.pure._
import cats.effect.kernel.testkit.TimeT._
import cats.laws.discipline.{arbitrary, MiniInt}

import org.scalacheck.{Arbitrary, Cogen, Prop}

import org.specs2.ScalaCheck
import org.specs2.scalacheck.Parameters
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

import scala.concurrent.duration._

class KleisliPureConcSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityKleisliInstances {
import PureConcGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,10 @@ import cats.effect.kernel.testkit.{freeEval, FreeSyncEq, FreeSyncGenerators, Syn
import cats.free.FreeT
import cats.laws.discipline.arbitrary._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class OptionTFreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with FreeSyncEq {
class OptionTFreeSyncSpec extends Specification with Discipline with BaseSpec with FreeSyncEq {

import FreeSyncGenerators._
import SyncTypeGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,18 @@ package laws
import cats.Applicative
import cats.data.OptionT
import cats.effect.kernel.Outcome
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._,
TimeT._
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._
import cats.effect.kernel.testkit.TimeT._
import cats.effect.kernel.syntax.all._
import cats.laws.discipline.arbitrary._
import cats.syntax.all._

import org.scalacheck.Prop

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

import scala.concurrent.duration._

class OptionTPureConcSpec extends Specification with Discipline with ScalaCheck with BaseSpec {
class OptionTPureConcSpec extends Specification with Discipline with BaseSpec {
import PureConcGenerators._
import OutcomeGenerators._

Expand Down
12 changes: 4 additions & 8 deletions laws/shared/src/test/scala/cats/effect/laws/PureConcSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@
package cats.effect
package laws

import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._,
TimeT._
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TimeT}, pure._
import cats.effect.kernel.testkit.TimeT._
import cats.laws.discipline.arbitrary._

import org.scalacheck.Prop

import org.specs2.ScalaCheck
import org.specs2.mutable._
import org.typelevel.discipline.specs2.mutable.Discipline

import scala.concurrent.duration._

import org.typelevel.discipline.specs2.mutable.Discipline

class PureConcSpec extends Specification with Discipline with ScalaCheck with BaseSpec {
class PureConcSpec extends Specification with Discipline with BaseSpec {
import PureConcGenerators._
import OutcomeGenerators._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ import cats.effect.kernel.testkit.{freeEval, FreeSyncGenerators, SyncTypeGenerat
import cats.free.FreeT
import cats.laws.discipline.{arbitrary, MiniInt}, arbitrary._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class ReaderWriterStateTFreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityImplicits {
import FreeSyncGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,11 @@ import cats.{Eq, Monad}
import cats.data.ReaderWriterStateT
import cats.effect.kernel.testkit.{pure, PureConcGenerators}, pure._
import cats.laws.discipline.{arbitrary, eq, MiniInt}, arbitrary._, eq._

import org.specs2.ScalaCheck
import org.specs2.scalacheck.Parameters
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class ReaderWriterStateTPureConcSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec {
class ReaderWriterStateTPureConcSpec extends Specification with Discipline with BaseSpec {
import PureConcGenerators._

implicit def rwstEq[F[_]: Monad, E, L, S, A](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,13 @@ import cats.effect.kernel.{MonadCancel, Resource}
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators, TestInstances}
import cats.laws.discipline.arbitrary._
import cats.syntax.all._

import org.scalacheck.{Cogen, Prop}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class ResourcePureConcSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with TestInstances {
import PureConcGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ import cats.effect.kernel.testkit.{freeEval, FreeSyncGenerators, SyncTypeGenerat
import cats.free.FreeT
import cats.laws.discipline.{arbitrary, MiniInt}, arbitrary._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class StateTFreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityImplicits {
import FreeSyncGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ import cats.{Eq, FlatMap}
import cats.data.StateT
import cats.effect.kernel.testkit.{pure, PureConcGenerators}, pure._
import cats.laws.discipline.{arbitrary, eq, MiniInt}, arbitrary._, eq._

// import org.scalacheck.rng.Seed

import org.specs2.ScalaCheck
import org.specs2.mutable._
// import org.specs2.scalacheck.Parameters

import org.specs2.scalacheck.Parameters
import org.typelevel.discipline.specs2.mutable.Discipline

class StateTPureConcSpec extends Specification with Discipline with ScalaCheck with BaseSpec {
class StateTPureConcSpec extends Specification with Discipline with BaseSpec {
import PureConcGenerators._

implicit def stateTEq[F[_]: FlatMap, S, A](
Expand All @@ -40,5 +36,6 @@ class StateTPureConcSpec extends Specification with Discipline with ScalaCheck w
checkAll(
"StateT[PureConc]",
MonadCancelTests[StateT[PureConc[Int, *], MiniInt, *], Int].monadCancel[Int, Int, Int]
) /*(Parameters(minTestsOk = 25, seed = Some(Seed.fromBase64("Ky43MND8m5h-10MZTckMFFAW6ea2pXWkFDE2A7ddtML=").get)))*/
)(Parameters(minTestsOk =
25 /*, seed = Some(Seed.fromBase64("Ky43MND8m5h-10MZTckMFFAW6ea2pXWkFDE2A7ddtML=").get*/ ))
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ import cats.effect.kernel.testkit.{freeEval, FreeSyncGenerators, SyncTypeGenerat
import cats.free.FreeT
import cats.laws.discipline.arbitrary._
import freeEval.{syncForFreeT, FreeEitherSync}

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.typelevel.discipline.specs2.mutable.Discipline

class WriterTFreeSyncSpec
extends Specification
with Discipline
with ScalaCheck
with BaseSpec
with LowPriorityImplicits {
import FreeSyncGenerators._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ import cats.laws.discipline.arbitrary._
import cats.effect.kernel.testkit._
import cats.effect.kernel.testkit.TimeT._
import cats.effect.kernel.testkit.{pure, OutcomeGenerators, PureConcGenerators}, pure._

import org.scalacheck.Prop

import org.specs2.ScalaCheck
import org.specs2.mutable._
import org.typelevel.discipline.specs2.mutable.Discipline

import scala.concurrent.duration._

import org.typelevel.discipline.specs2.mutable.Discipline

class WriterTPureConcSpec extends Specification with Discipline with ScalaCheck with BaseSpec {
class WriterTPureConcSpec extends Specification with Discipline with BaseSpec {
import PureConcGenerators._
import OutcomeGenerators._

Expand Down
15 changes: 3 additions & 12 deletions laws/shared/src/test/scala/cats/effect/testkit/TimeTSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,11 @@ package cats.effect.kernel.testkit
import cats.{Eq, Order}
import cats.effect.laws.GenTemporalTests
import cats.laws.discipline.arbitrary._

import pure.PureConc
import TimeT._

import org.specs2.ScalaCheck
import org.specs2.mutable._

import org.scalacheck.{Arbitrary, Cogen, Gen, Prop}

import org.typelevel.discipline.specs2.mutable.Discipline
import pure.PureConc
import TimeT._

import scala.concurrent.duration._

Expand All @@ -40,11 +35,7 @@ private[testkit] trait LowPriorityInstances {
Eq.by(TimeT.run(_))
}

class TimeTSpec
extends Specification
with Discipline
with ScalaCheck
with LowPriorityInstances {
class TimeTSpec extends Specification with Discipline with LowPriorityInstances {

import PureConcGenerators._
import OutcomeGenerators._
Expand Down
Loading