From 7ae4bc9a8e41c1215b71a2c859728925df7b5521 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Wed, 4 Aug 2021 23:05:11 +0200 Subject: [PATCH 1/4] Simplify IOPlatformSpecification inheritance --- .../scala/cats/effect/IOPlatformSpecification.scala | 3 +-- .../scala/cats/effect/IOPlatformSpecification.scala | 3 +-- .../src/test/scala/cats/effect/EitherTIOSpec.scala | 11 +---------- .../src/test/scala/cats/effect/IOPropSpec.scala | 10 ++-------- tests/shared/src/test/scala/cats/effect/IOSpec.scala | 4 +--- .../src/test/scala/cats/effect/IorTIOSpec.scala | 7 +------ .../src/test/scala/cats/effect/KleisliIOSpec.scala | 11 +---------- .../src/test/scala/cats/effect/OptionTIOSpec.scala | 11 +---------- .../src/test/scala/cats/effect/WriterTIOSpec.scala | 11 +---------- 9 files changed, 10 insertions(+), 61 deletions(-) diff --git a/tests/js/src/test/scala/cats/effect/IOPlatformSpecification.scala b/tests/js/src/test/scala/cats/effect/IOPlatformSpecification.scala index cff5c4ed3b..2ccec13e85 100644 --- a/tests/js/src/test/scala/cats/effect/IOPlatformSpecification.scala +++ b/tests/js/src/test/scala/cats/effect/IOPlatformSpecification.scala @@ -21,9 +21,8 @@ import cats.syntax.all._ import org.scalacheck.Prop.forAll import org.specs2.ScalaCheck -import org.specs2.mutable.Specification -abstract class IOPlatformSpecification extends Specification with ScalaCheck with Runners { +trait IOPlatformSpecification { self: BaseSpec with ScalaCheck => def platformSpecs = "platform" should { diff --git a/tests/jvm/src/test/scala/cats/effect/IOPlatformSpecification.scala b/tests/jvm/src/test/scala/cats/effect/IOPlatformSpecification.scala index 740edc5083..59405e66d9 100644 --- a/tests/jvm/src/test/scala/cats/effect/IOPlatformSpecification.scala +++ b/tests/jvm/src/test/scala/cats/effect/IOPlatformSpecification.scala @@ -22,7 +22,6 @@ import cats.effect.std.Semaphore import org.scalacheck.Prop.forAll import org.specs2.ScalaCheck -import org.specs2.mutable.Specification import scala.concurrent.ExecutionContext import scala.concurrent.duration._ @@ -30,7 +29,7 @@ import scala.concurrent.duration._ import java.util.concurrent.{CancellationException, CountDownLatch, Executors} import java.util.concurrent.CompletableFuture -abstract class IOPlatformSpecification extends Specification with ScalaCheck with Runners { +trait IOPlatformSpecification { self: BaseSpec with ScalaCheck => def platformSpecs = { "platform" should { diff --git a/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala index 3bce5e5bda..5941af746c 100644 --- a/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/EitherTIOSpec.scala @@ -22,21 +22,12 @@ import cats.effect.laws.AsyncTests import cats.effect.syntax.all._ import cats.laws.discipline.arbitrary._ import cats.syntax.all._ - import org.scalacheck.Prop - -import org.specs2.ScalaCheck - import org.typelevel.discipline.specs2.mutable.Discipline import scala.concurrent.duration._ -class EitherTIOSpec - extends IOPlatformSpecification - with Discipline - with ScalaCheck - with BaseSpec { - outer => +class EitherTIOSpec extends BaseSpec with Discipline { // we just need this because of the laws testing, since the prop runs can interfere with each other sequential diff --git a/tests/shared/src/test/scala/cats/effect/IOPropSpec.scala b/tests/shared/src/test/scala/cats/effect/IOPropSpec.scala index b5f1efc38f..c1796664d9 100644 --- a/tests/shared/src/test/scala/cats/effect/IOPropSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/IOPropSpec.scala @@ -19,20 +19,14 @@ package cats.effect import cats.syntax.all._ import cats.effect.implicits._ import cats.effect.std.Queue - import org.scalacheck.Arbitrary.arbitrary - -import org.specs2.ScalaCheck - +import org.scalacheck.Gen import org.typelevel.discipline.specs2.mutable.Discipline -import org.scalacheck.Gen -import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration._ //We allow these tests to have a longer timeout than IOSpec as they run lots of iterations -class IOPropSpec extends IOPlatformSpecification with Discipline with ScalaCheck with BaseSpec { - outer => +class IOPropSpec extends BaseSpec with Discipline { override def executionTimeout: FiniteDuration = 30.second diff --git a/tests/shared/src/test/scala/cats/effect/IOSpec.scala b/tests/shared/src/test/scala/cats/effect/IOSpec.scala index 216f9a050d..c90e4778b5 100644 --- a/tests/shared/src/test/scala/cats/effect/IOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/IOSpec.scala @@ -28,7 +28,6 @@ import cats.syntax.all._ import org.scalacheck.Prop, Prop.forAll // import org.scalacheck.rng.Seed -import org.specs2.ScalaCheck // import org.specs2.scalacheck.Parameters import org.typelevel.discipline.specs2.mutable.Discipline @@ -36,8 +35,7 @@ import org.typelevel.discipline.specs2.mutable.Discipline import scala.concurrent.{ExecutionContext, TimeoutException} import scala.concurrent.duration._ -class IOSpec extends IOPlatformSpecification with Discipline with ScalaCheck with BaseSpec { - outer => +class IOSpec extends BaseSpec with Discipline with IOPlatformSpecification { // we just need this because of the laws testing, since the prop runs can interfere with each other sequential diff --git a/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala index 6d6e013350..df380dbcf2 100644 --- a/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/IorTIOSpec.scala @@ -22,17 +22,12 @@ import cats.effect.laws.AsyncTests import cats.effect.syntax.all._ import cats.laws.discipline.arbitrary._ import cats.syntax.all._ - import org.scalacheck.Prop - -import org.specs2.ScalaCheck - import org.typelevel.discipline.specs2.mutable.Discipline import scala.concurrent.duration._ -class IorTIOSpec extends IOPlatformSpecification with Discipline with ScalaCheck with BaseSpec { - outer => +class IorTIOSpec extends BaseSpec with Discipline { // we just need this because of the laws testing, since the prop runs can interfere with each other sequential diff --git a/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala b/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala index 8f36e81ed9..a9cd88eb73 100644 --- a/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/KleisliIOSpec.scala @@ -24,22 +24,13 @@ import cats.laws.discipline.MiniInt import cats.laws.discipline.arbitrary._ import cats.laws.discipline.eq._ import cats.syntax.all._ - import org.scalacheck.{Cogen, Prop} - -import org.specs2.ScalaCheck import org.specs2.scalacheck.Parameters - import org.typelevel.discipline.specs2.mutable.Discipline import scala.concurrent.duration._ -class KleisliIOSpec - extends IOPlatformSpecification - with Discipline - with ScalaCheck - with BaseSpec { - outer => +class KleisliIOSpec extends BaseSpec with Discipline { // we just need this because of the laws testing, since the prop runs can interfere with each other sequential diff --git a/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala index 44636f4c92..f54806d777 100644 --- a/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/OptionTIOSpec.scala @@ -22,23 +22,14 @@ import cats.effect.laws.AsyncTests import cats.effect.syntax.all._ import cats.laws.discipline.arbitrary._ import cats.syntax.all._ - import org.scalacheck.Prop // import org.scalacheck.rng.Seed - -import org.specs2.ScalaCheck // import org.specs2.scalacheck.Parameters - import org.typelevel.discipline.specs2.mutable.Discipline import scala.concurrent.duration._ -class OptionTIOSpec - extends IOPlatformSpecification - with Discipline - with ScalaCheck - with BaseSpec { - outer => +class OptionTIOSpec extends BaseSpec with Discipline { // we just need this because of the laws testing, since the prop runs can interfere with each other sequential diff --git a/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala b/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala index eed89cc58f..fa91546348 100644 --- a/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/WriterTIOSpec.scala @@ -22,21 +22,12 @@ import cats.effect.laws.AsyncTests import cats.effect.syntax.all._ import cats.laws.discipline.arbitrary._ import cats.syntax.all._ - import org.scalacheck.Prop - -import org.specs2.ScalaCheck - import org.typelevel.discipline.specs2.mutable.Discipline import scala.concurrent.duration._ -class WriterTIOSpec - extends IOPlatformSpecification - with Discipline - with ScalaCheck - with BaseSpec { - outer => +class WriterTIOSpec extends BaseSpec with Discipline { // we just need this because of the laws testing, since the prop runs can interfere with each other sequential From 460cd8d9b0aa075424f99b1dec791aa00ed1d86b Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Wed, 4 Aug 2021 23:07:25 +0200 Subject: [PATCH 2/4] Simplify SyncIOPlatformSpecification inheritance --- .../scala/cats/effect/SyncIOPlatformSpecification.scala | 4 +--- .../scala/cats/effect/SyncIOPlatformSpecification.scala | 4 +--- tests/shared/src/test/scala/cats/effect/SyncIOSpec.scala | 7 +------ 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/js/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala b/tests/js/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala index ce56949bb1..d4e983a753 100644 --- a/tests/js/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala +++ b/tests/js/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala @@ -16,9 +16,7 @@ package cats.effect -import org.specs2.mutable.Specification - -abstract class SyncIOPlatformSpecification extends Specification with Runners { +trait SyncIOPlatformSpecification { self: BaseSpec => def platformSpecs = { "platform" should { "realTimeDate should return an Instant constructed from realTime" in { diff --git a/tests/jvm/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala b/tests/jvm/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala index 38fbd2e873..e2d960f6d3 100644 --- a/tests/jvm/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala +++ b/tests/jvm/src/test/scala/cats/effect/SyncIOPlatformSpecification.scala @@ -16,9 +16,7 @@ package cats.effect -import org.specs2.mutable.Specification - -abstract class SyncIOPlatformSpecification extends Specification with Runners { +trait SyncIOPlatformSpecification { self: BaseSpec => def platformSpecs = { "platform" should { "realTimeInstant should return an Instant constructed from realTime" in { diff --git a/tests/shared/src/test/scala/cats/effect/SyncIOSpec.scala b/tests/shared/src/test/scala/cats/effect/SyncIOSpec.scala index 31832f947d..7722742d96 100644 --- a/tests/shared/src/test/scala/cats/effect/SyncIOSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/SyncIOSpec.scala @@ -23,14 +23,9 @@ import cats.effect.laws.SyncTests import cats.syntax.all._ import org.scalacheck.Prop import Prop.forAll -import org.specs2.ScalaCheck import org.typelevel.discipline.specs2.mutable.Discipline -class SyncIOSpec - extends SyncIOPlatformSpecification - with Discipline - with ScalaCheck - with BaseSpec { +class SyncIOSpec extends BaseSpec with Discipline with SyncIOPlatformSpecification { "sync io monad" should { "produce a pure value when run" in { From 14263f0cff54167d0c130535d76f34df25299490 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Wed, 4 Aug 2021 23:19:30 +0200 Subject: [PATCH 3/4] No need for both Discipline and ScalaCheck --- .../test/scala/cats/effect/laws/ClockSpec.scala | 5 +---- .../cats/effect/laws/EitherTFreeSyncSpec.scala | 2 -- .../cats/effect/laws/EitherTPureConcSpec.scala | 12 ++++-------- .../scala/cats/effect/laws/FreeSyncSpec.scala | 4 ---- .../scala/cats/effect/laws/IorTFreeSyncSpec.scala | 4 ---- .../scala/cats/effect/laws/IorTPureConcSpec.scala | 10 +++------- .../cats/effect/laws/KleisliFreeSyncSpec.scala | 4 ---- .../cats/effect/laws/KleisliPureConcSpec.scala | 10 +++------- .../cats/effect/laws/OptionTFreeSyncSpec.scala | 10 +--------- .../cats/effect/laws/OptionTPureConcSpec.scala | 10 +++------- .../scala/cats/effect/laws/PureConcSpec.scala | 12 ++++-------- .../laws/ReaderWriterStateTFreeSyncSpec.scala | 4 ---- .../laws/ReaderWriterStateTPureConcSpec.scala | 9 +-------- .../cats/effect/laws/ResourcePureConcSpec.scala | 5 ----- .../cats/effect/laws/StateTFreeSyncSpec.scala | 4 ---- .../cats/effect/laws/StateTPureConcSpec.scala | 6 +----- .../cats/effect/laws/WriterTFreeSyncSpec.scala | 4 ---- .../cats/effect/laws/WriterTPureConcSpec.scala | 8 ++------ .../scala/cats/effect/testkit/TimeTSpec.scala | 15 +++------------ .../src/test/scala/cats/effect/MemoizeSpec.scala | 6 +----- 20 files changed, 27 insertions(+), 117 deletions(-) diff --git a/laws/shared/src/test/scala/cats/effect/laws/ClockSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/ClockSpec.scala index 78d524c3f0..ca45206414 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/ClockSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/ClockSpec.scala @@ -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) diff --git a/laws/shared/src/test/scala/cats/effect/laws/EitherTFreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/EitherTFreeSyncSpec.scala index df34ae9588..c13e548b6e 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/EitherTFreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/EitherTFreeSyncSpec.scala @@ -24,7 +24,6 @@ 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 @@ -32,7 +31,6 @@ import org.typelevel.discipline.specs2.mutable.Discipline class EitherTFreeSyncSpec extends Specification with Discipline - with ScalaCheck with BaseSpec with LowPriorityImplicits { import FreeSyncGenerators._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/EitherTPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/EitherTPureConcSpec.scala index 6cfedb091b..e57d462889 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/EitherTPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/EitherTPureConcSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/FreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/FreeSyncSpec.scala index bc12f6b731..b1fc66b8f1 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/FreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/FreeSyncSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/IorTFreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/IorTFreeSyncSpec.scala index 3ee18b41d8..db6ffa00f8 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/IorTFreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/IorTFreeSyncSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/IorTPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/IorTPureConcSpec.scala index 9301697107..94860a5352 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/IorTPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/IorTPureConcSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/KleisliFreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/KleisliFreeSyncSpec.scala index 860b97b20e..5f17f6e6ff 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/KleisliFreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/KleisliFreeSyncSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/KleisliPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/KleisliPureConcSpec.scala index 03a77606e6..74e1dc3af0 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/KleisliPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/KleisliPureConcSpec.scala @@ -20,16 +20,13 @@ 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._ @@ -37,7 +34,6 @@ import scala.concurrent.duration._ class KleisliPureConcSpec extends Specification with Discipline - with ScalaCheck with BaseSpec with LowPriorityKleisliInstances { import PureConcGenerators._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/OptionTFreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/OptionTFreeSyncSpec.scala index 06086fabf4..0977aa34ed 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/OptionTFreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/OptionTFreeSyncSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/OptionTPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/OptionTPureConcSpec.scala index e8c3d2fc01..f77f35c0da 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/OptionTPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/OptionTPureConcSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/PureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/PureConcSpec.scala index 7ef4c0fd3f..f7dd2983a7 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/PureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/PureConcSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTFreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTFreeSyncSpec.scala index de9525e41e..91c99cc888 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTFreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTFreeSyncSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTPureConcSpec.scala index 895d75699d..6482bfa0f7 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/ReaderWriterStateTPureConcSpec.scala @@ -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]( diff --git a/laws/shared/src/test/scala/cats/effect/laws/ResourcePureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/ResourcePureConcSpec.scala index 0b51640a91..2af452124b 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/ResourcePureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/ResourcePureConcSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/StateTFreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/StateTFreeSyncSpec.scala index e56f3a9113..4af028590d 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/StateTFreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/StateTFreeSyncSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala index 3155fa8510..5aee6e727a 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala @@ -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.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]( diff --git a/laws/shared/src/test/scala/cats/effect/laws/WriterTFreeSyncSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/WriterTFreeSyncSpec.scala index c5d0445770..745e0f3b95 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/WriterTFreeSyncSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/WriterTFreeSyncSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/laws/WriterTPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/WriterTPureConcSpec.scala index bfec807eec..a6561b2772 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/WriterTPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/WriterTPureConcSpec.scala @@ -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._ diff --git a/laws/shared/src/test/scala/cats/effect/testkit/TimeTSpec.scala b/laws/shared/src/test/scala/cats/effect/testkit/TimeTSpec.scala index 0952d8707d..546c56c79d 100644 --- a/laws/shared/src/test/scala/cats/effect/testkit/TimeTSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/testkit/TimeTSpec.scala @@ -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._ @@ -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._ diff --git a/tests/shared/src/test/scala/cats/effect/MemoizeSpec.scala b/tests/shared/src/test/scala/cats/effect/MemoizeSpec.scala index a3433d51e0..09eed0f8eb 100644 --- a/tests/shared/src/test/scala/cats/effect/MemoizeSpec.scala +++ b/tests/shared/src/test/scala/cats/effect/MemoizeSpec.scala @@ -18,17 +18,13 @@ package cats package effect import cats.syntax.all._ - import org.scalacheck.Prop, Prop.forAll - -import org.specs2.ScalaCheck - import org.typelevel.discipline.specs2.mutable.Discipline import scala.concurrent.duration._ import scala.util.Success -class MemoizeSpec extends BaseSpec with Discipline with ScalaCheck { +class MemoizeSpec extends BaseSpec with Discipline { sequential From 1e130592d10280a79e372d933121c8a77b1d9cb9 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Wed, 4 Aug 2021 23:22:03 +0200 Subject: [PATCH 4/4] Restore the previous StateT laws threshold --- .../src/test/scala/cats/effect/laws/StateTPureConcSpec.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala b/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala index 5aee6e727a..afdfa8e3ff 100644 --- a/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala +++ b/laws/shared/src/test/scala/cats/effect/laws/StateTPureConcSpec.scala @@ -23,7 +23,7 @@ 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.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 BaseSpec { @@ -36,5 +36,6 @@ class StateTPureConcSpec extends Specification with Discipline with BaseSpec { 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*/ )) }