Skip to content

Commit

Permalink
Merge pull request #152 from alexarchambault/scalacheck-1.14.3
Browse files Browse the repository at this point in the history
Switch to scalacheck 1.14.3
  • Loading branch information
alexarchambault committed Feb 3, 2020
2 parents c5939d3 + 8354ef7 commit 9e5876e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ stages:
if: (branch = master AND type = push) OR (tag IS present)
jobs:
include:
- scala: 2.10.7
- scala: 2.11.12
- scala: 2.12.10
- scala: 2.13.1
Expand Down
2 changes: 1 addition & 1 deletion project/Deps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Deps {

import Def.setting

def scalacheck = setting("org.scalacheck" %%% "scalacheck" % "1.14.0")
def scalacheck = setting("org.scalacheck" %%% "scalacheck" % "1.14.3")
def shapeless = setting("com.chuusai" %%% "shapeless" % "2.3.3")
def utest = setting {
val sv = scalaVersion.value
Expand Down
11 changes: 2 additions & 9 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@ import Aliases._

object Settings {

private def scala210 = "2.10.7"
private def scala211 = "2.11.12"
private def scala212 = "2.12.10"
private def scala213 = "2.13.1"

lazy val shared = Seq(
scalaVersion := scala212,
crossScalaVersions := Seq(scala213, scala212, scala211, scala210),
libs ++= {
if (scalaBinaryVersion.value == "2.10")
Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.patch))
else
Seq()
},
crossScalaVersions := Seq(scala213, scala212, scala211),
scalacOptions ++= {
scalaBinaryVersion.value match {
case "2.10" | "2.11" =>
case "2.11" =>
Seq("-target:jvm-1.7")
case _ =>
Nil
Expand Down
8 changes: 8 additions & 0 deletions test/shared/src/test/scala/org/scalacheck/PropTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.scalacheck
import utest._
import Util._
import ScalacheckShapeless._
import org.scalacheck.derive.{MkArbitrary, Recursive}
import org.scalacheck.TestsDefinitions.{T1, T1NoRecursiveTC}

object PropTests extends TestSuite {
Expand Down Expand Up @@ -30,6 +31,13 @@ object PropTests extends TestSuite {
'recursiveADT - {
case class Node[T](value: T, left: Option[Node[T]], right: Option[Node[T]])

// deriving the Arbitrary[Option[…]] ourselves, so that it safely
// unties the recursion
implicit def rec[T]: Recursive[Option[Node[T]]] =
Recursive[Option[Node[T]]](Gen.const(None))
implicit def arb[T: Arbitrary]: Arbitrary[Option[Node[T]]] =
MkArbitrary[Option[Node[T]]].arbitrary

val prop = Prop.forAll { (f: Int => Node[Int]) => f(0); true }

prop.validate()
Expand Down

0 comments on commit 9e5876e

Please sign in to comment.