Skip to content

Commit

Permalink
ZIO 2.0.0-RC5 (#905)
Browse files Browse the repository at this point in the history
* ZIO 2.0.0-RC5

* Fix type of spec

* Fix type of spec
  • Loading branch information
vigoo authored Apr 9, 2022
1 parent 86a55cb commit 5255a0c
Show file tree
Hide file tree
Showing 44 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ addCommandAlias(
";lawsNative/test;experimentalLawsNative/test" // `test` currently executes only compilation, see `nativeSettings` in `BuildHelper`
)

val zioVersion = "2.0.0-RC4"
val zioVersion = "2.0.0-RC5"

lazy val root = project
.in(file("."))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import zio.test.{ZIOSpecDefault, ZSpec, assert}

object AssertionSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] = suite("Assertion")(
def spec: ZSpec[Environment, Any] = suite("Assertion")(
test("matches must fail when the regex only match a part of the string") {
assert((Assertion.matches("biking").apply("toto like biking")))(isLeft(anything))
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object AssociativeBothSpec extends ZIOSpecDefault {
implicit val chunkOptionAssociativeBoth: AssociativeBoth[ChunkOption] =
AssociativeBoth.compose[Chunk, Option]

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("AssociativeBothSpec")(
suite("laws")(
test("chunk . option")(checkAllLaws(AssociativeBothLaws)(chunkOptionGenF, Gen.int))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.test.laws._

object AssociativeEitherSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("AssociativeEitherSpec")(
suite("laws")(
test("either")(checkAllLaws(AssociativeEitherLaws)(GenF.either(Gen.int), Gen.int))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.test.laws._

object AssociativeFlattenSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("AssociativeFlattenSpec")(
suite("laws")(
test("map")(checkAllLaws(AssociativeFlattenLaws)(GenFs.map(Gen.int), Gen.int))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import zio.test._

object AssociativeSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("AssociativeSpec")(
suite("laws")(
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import zio.test._

object CoherentSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("CoherentSpec")(
test("HashOrd") {
val instance = implicitly[HashOrd[Double]].contramap[Int](_.toDouble)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.test.laws._

object CommutativeBothSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("CommutativeBothSpec")(
suite("laws")(
test("chunk")(checkAllLaws(CommutativeBothLaws)(GenF.chunk, Gen.chunkOf(Gen.int))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object CommutativeEitherSpec extends ZIOSpecDefault {

coherent.CommutativeEitherDeriveEqualInvariant.derive[Set]

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("CommutativeEitherSpec")(
suite("laws")(
test("set")(checkAllLaws(CommutativeEitherLaws)(GenF.set, Gen.int))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object CommutativeSpec extends ZIOSpecDefault {
private implicit val DoubleEqual: Equal[Double] = Equal.DoubleEqualWithEpsilon()
private implicit val FloatEqual: Equal[Float] = Equal.FloatEqualWithEpsilon()

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("CommutativeSpec")(
suite("laws")(
test("boolean conjuction")(checkAllLaws(CommutativeLaws)(Gen.boolean.map(And(_)))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object CovariantSpec extends ZIOSpecDefault {
implicit val chunkOptionCovariant: Covariant[ChunkOption] =
Covariant[Chunk].compose(Covariant[Option])

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("CovariantSpec")(
suite("laws")(
test("cause")(checkAllLaws(CovariantLaws)(GenFs.cause, Gen.int)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object DebugSpec extends ZIOSpecDefault {
def expectedTupleFull(n: Int)(v: Int): String = s"scala.Tuple$n(${List.fill(n)(v).mkString(", ")})"
def expectedTupleSimple(n: Int)(v: Int): String = s"(${List.fill(n)(v).mkString(", ")})"

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("DebugSpec")(
suite("ScalaRenderer")(
test("unit")(check(Gen.unit)(primScalaTest(_, Some("()")))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.test.laws._

object EqualSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("EqualSpec")(
suite("laws")(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object EquivalenceSpec extends ZIOSpecDefault {
val genNothing: Gen[Any, Nothing] =
Gen(ZStream.empty)

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("EquivalenceSpec")(
suite("laws")(
test("either") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ object ForEachSpec extends ZIOSpecDefault {
implicit val chunkOptionForEach: ForEach[ChunkOption] =
ForEach[Chunk].compose[Option]

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("ForEachSpec")(
suite("laws")(
test("chunk")(checkAllLaws(ForEachLaws)(GenF.chunk, Gen.int)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object HashSpec extends ZIOSpecDefault {
final def scalaHashCodeConsistency[R, A: Hash](gen: Gen[R, A]): ZIO[R with TestConfig, Nothing, TestResult] =
check(gen)(a => assert(a.hash)(equalTo(a.hashCode)))

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("HashSpec")(
suite("laws")(
test("boolean")(checkAllLaws(HashLaws)(Gen.boolean)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object IdempotentSpec extends ZIOSpecDefault {
private implicit val DoubleEqual: Equal[Double] = Equal.DoubleEqualWithEpsilon()
private implicit val FloatEqual: Equal[Float] = Equal.FloatEqualWithEpsilon()

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("IdempotentSpec")(
suite("laws")(
test("boolean conjuction")(checkAllLaws(IdempotentLaws)(Gen.boolean.map(And(_)))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.test.laws._

object IdentityBothSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("IdentityBothSpec")(
suite("laws")(
test("either")(checkAllLaws(IdentityBothLaws)(GenF.either(Gen.int), Gen.int)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.test.laws._

object IdentityEitherSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("IdentityEitherSpec")(
suite("laws")(
test("chunk")(checkAllLaws(IdentityEitherlaws)(GenF.chunk, Gen.int)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.test.laws._

object IdentityFlattenSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("IdentityFlattenSpec")(
suite("laws")(
test("chunk")(checkAllLaws(IdentityFlattenLaws)(GenF.chunk, Gen.chunkOf(Gen.int))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object IdentitySpec extends ZIOSpecDefault {
private implicit val DoubleEqual: Equal[Double] = Equal.DoubleEqualWithEpsilon()
private implicit val FloatEqual: Equal[Float] = Equal.FloatEqualWithEpsilon()

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("IdentitySpec")(
suite("laws")(
test("boolean conjuction")(checkAllLaws(IdentityLaws)(Gen.boolean.map(And(_)))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object InverseSpec extends ZIOSpecDefault {
private implicit val DoubleEqual: Equal[Double] = Equal.DoubleEqualWithEpsilon()
private implicit val FloatEqual: Equal[Float] = Equal.FloatEqualWithEpsilon()

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("InverseSpec")(
suite("laws")(
test("byte addition")(checkAllLaws(InverseLaws)(Gen.byte.map(Sum(_)))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.test.laws._

object NaturalSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("NaturalSpec")(
suite("laws")(
test("product commutative")(checkAllLaws(CommutativeLaws)(Gens.anyNatural.map(Prod(_)))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object NonEmptyForEachSpec extends ZIOSpecDefault {
val genIntFunction2: Gen[Any, (Int, Int) => Int] =
Gen.function2(genInt)

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("NonEmptyForEachSpec")(
suite("laws")(
test("nonEmptyChunk")(checkAllLaws(NonEmptyForEachLaws)(GenFs.nonEmptyChunk, Gen.int))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object NonEmptyListSpec extends ZIOSpecDefault {
index <- Gen.int(-2, cons.length + 2)
} yield (cons, index)

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("NonEmptyListSpec")(
suite("laws")(
test("associative")(checkAllLaws(AssociativeLaws)(genNonEmptyList)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object NonEmptySetSpec extends ZIOSpecDefault {
private lazy val genNonEmptySet: Gen[Sized, NonEmptySet[Int]] =
genSet.map(NonEmptySet.fromSetOption(_).get)

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("NonEmptySetSpec")(
suite("laws")(
test("commutativeEither")(checkAllLaws(CommutativeEitherLaws)(GenFs.nonEmptySet, Gen.int)),
Expand Down
2 changes: 1 addition & 1 deletion core-tests/shared/src/test/scala/zio/prelude/OrdSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object OrdSpec extends ZIOSpecDefault {
}
}

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("OrdSpec")(
suite("laws")(
test("boolean")(checkAllLaws(OrdLaws)(Gen.boolean)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object ParSeqSpec extends ZIOSpecDefault {

val hash = ParSeq.parSeqHash

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("parSeqSpec")(
suite("laws")(
test("covariant") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.test.laws._

object PartialOrdSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("OrdSpec")(
suite("laws")(
test("map")(checkAllLaws(PartialOrdLaws)(Gen.mapOf(Gen.int, Gen.int))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object SafeFunctionSpec extends ZIOSpecDefault {
def increment(n: Int): Int =
n + 1

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("SafeFunctionSpec")(
test("andThen") {
val wordCount = SafeFunction(words) andThen SafeFunction(count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object ZNonEmptySetSpec extends ZIOSpecDefault {
implicit def SumIdentity[A: Identity]: Identity[Sum[A]] =
Identity[A].invmap(Equivalence(Sum.wrap, Sum.unwrap))

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("ZNonEmptySetSpec")(
suite("laws")(
test("combine commutative")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object ZSetSpec extends ZIOSpecDefault {
implicit def SumIdentity[A: Identity]: Identity[Sum[A]] =
Identity[A].invmap(Equivalence(Sum.wrap, Sum.unwrap))

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("ZSetSpec")(
suite("laws")(
test("combine commutative")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object ZValidationSpec extends ZIOSpecDefault {
val genFValidationFailure: GenF[Sized, ({ type lambda[+x] = newtypes.Failure[ZValidation[Int, x, Int]] })#lambda] =
GenFs.validationFailure(Gen.int, Gen.int)

def spec: ZSpec[Environment, Failure] = suite("ZValidationSpec")(
def spec: ZSpec[Environment, Any] = suite("ZValidationSpec")(
suite("laws")(
test("associativeBoth")(checkAllLaws(AssociativeBothLaws)(genFValidation, Gen.int)),
test("commutativeBoth")(checkAllLaws(CommutativeBothLaws)(genFValidation, Gen.int)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object ZPureSpec extends ZIOSpecDefault {
lazy val genStateState: Gen[Any, State[Int, State[Int, Int]]] =
Gens.state(genInt, genState)

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("ZPureSpec")(
suite("context")(
suite("constructors")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.test.laws._

object DistributiveAbsorptionSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("DistributiveAbsorptionSpec")(
suite("laws")(
test("set")(checkAllLaws(DistributiveAbsorptionLaws)(Gen.setOf(Gen.int))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.test.laws._

object ExcludedMiddleSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("ExcludedMiddleSpec")(
suite("laws")(
test("boolean")(checkAllLaws(ExcludedMiddleLaws)(Gen.boolean))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.test.laws._

object InvolutionSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("InvolutionSpec")(
suite("laws")(
test("boolean")(checkAllLaws(InvolutionLaws)(Gen.boolean))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.test.laws._

object NoncontradictionSpec extends ZIOSpecDefault {

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("NoncontradictionSpec")(
suite("laws")(
test("boolean")(checkAllLaws(NoncontradictionLaws)(Gen.boolean))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object AssociativeFlattenJvmSpec extends ZIOSpecDefault {
Gen.mapOf(k, v).map(_.par)
}

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("AssociativeFlattenJvmSpec")(
suite("laws")(
test("parMap")(checkAllLaws(AssociativeFlattenLaws)(genParMap(Gen.int), Gen.int))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object ForEachJvmSpec extends ZIOSpecDefault {
Gen.listOf(gen).map(_.par)
}

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("ForEachJvmSpec")(
suite("laws")(
test("parMap")(checkAllLaws(ForEachLaws)(genParMap(Gen.int), Gen.int)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object HashJvmSpec extends ZIOSpecDefault {
}
import ParallelCollectionCompatibility._

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("HashJvmSpec")(
suite("laws")(
test("parMap")(checkAllLaws(HashLaws)(Gen.mapOf(Gen.int, Gen.int).map(_.par))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object IdentityFlattenJvmSpec extends ZIOSpecDefault {
Gen.listOf(gen).map(_.par)
}

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("IdentityFlattenJvmSpec")(
suite("laws")(
test("parSeq")(checkAllLaws(IdentityFlattenLaws)(genParSeq, Gen.int))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object OrdJvmSpec extends ZIOSpecDefault {
}
import ParallelCollectionCompatibility._

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("OrdJvmSpec")(
suite("laws")(
test("parSeq")(checkAllLaws(OrdLaws)(Gen.listOf(Gen.int).map(_.par)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object PartialOrdJvmSpec extends ZIOSpecDefault {
}
import ParallelCollectionCompatibility._

def spec: ZSpec[Environment, Failure] =
def spec: ZSpec[Environment, Any] =
suite("EqualJvmSpec")(
suite("laws")(
test("parMap")(checkAllLaws(PartialOrdLaws)(Gen.mapOf(Gen.int, Gen.int).map(_.par))),
Expand Down

0 comments on commit 5255a0c

Please sign in to comment.