-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update/cats-core-2.10.0
- Loading branch information
Showing
5 changed files
with
167 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
munit/shared/src/test/scala/munit/ScalaCheckEffectSuiteSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2021 Typelevel | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package munit | ||
|
||
import cats.effect.IO | ||
import cats.effect.unsafe.implicits.global | ||
import org.scalacheck.effect.PropF | ||
import org.scalacheck.Shrink | ||
|
||
// Who tests the tests? | ||
class ScalaCheckEffectSuiteSuite extends ScalaCheckEffectSuite { | ||
|
||
implicit def noShrink[T]: Shrink[T] = Shrink.shrinkAny[T] | ||
|
||
override def munitValueTransforms: List[ValueTransform] = | ||
super.munitValueTransforms ++ List(munitIOTransform) | ||
|
||
// From https://github.com/scalameta/munit/pull/134 | ||
private val munitIOTransform: ValueTransform = | ||
new ValueTransform("IO", { case e: IO[_] => e.unsafeToFuture() }) | ||
|
||
test("Correctly slides seed for multi-arg PropF") { | ||
var last: Option[Int] = None | ||
var duplicates = 0 | ||
|
||
PropF.forAllF { (x: Int, y: Int) => | ||
if (Some(x) == last) { | ||
duplicates = duplicates + 1 | ||
} | ||
last = Some(y) | ||
|
||
// This is a bit of a heuristic as the generator may genuinely produce identical consecutive values | ||
// The bug was that it wasn't sliding so the first generated value was _always_ equal to the second | ||
// generated value from the previous iteration | ||
IO { assert(clue(duplicates) < 10) } | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.8.3 | ||
sbt.version=1.9.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.1") | ||
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.21") | ||
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.12") | ||
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.1") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0") | ||
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.6.7") | ||
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") | ||
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") |