Skip to content

Commit 75f16bc

Browse files
committed
Remove methods that was deprecated in 1.13.x
1 parent 5078587 commit 75f16bc

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

jvm/src/test/scala/org/scalacheck/GenSpecification.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,6 @@ object GenSpecification extends Properties("Gen") {
8080
fail(prms, seed) == None
8181
}
8282

83-
property("fromOption") = forAll { (prms: Parameters, seed: Seed, o: Option[Int]) =>
84-
o match {
85-
case Some(x) => fromOption(o)(prms, seed) == Some(x)
86-
case None => fromOption(o)(prms, seed) == None
87-
}
88-
}
89-
90-
property("collect") = forAll { (prms: Parameters, o: Option[Int], seed: Seed) =>
91-
val g = const(o).collect { case Some(n) => n }
92-
o match {
93-
case Some(x) => g(prms, seed) == Some(x)
94-
case None => g(prms, seed) == None
95-
}
96-
}
97-
9883
property("choose-int") = forAll { (l: Int, h: Int) =>
9984
Try(choose(l, h)) match {
10085
case Success(g) => forAll(g) { x => l <= x && x <= h }

src/main/scala/org/scalacheck/Gen.scala

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ sealed abstract class Gen[+T] extends Serializable { self =>
8383
rt.flatMap(t => f(t).doApply(p, rt.seed))
8484
}
8585

86-
@deprecated("Empty generators are discouraged.", "1.14.0")
87-
def flatten[U](implicit asOption: T => Option[U]): Gen[U] =
88-
map(asOption).collect{ case Some(t) => t }
89-
9086
/** Create a new generator that uses this generator to produce a value
9187
* that fulfills the given condition. If the condition is not fulfilled,
9288
* the generator fails (returns None). Also, make sure that the provided
@@ -99,13 +95,6 @@ sealed abstract class Gen[+T] extends Serializable { self =>
9995
* test property is side-effect free, eg it should not use external vars. */
10096
def filterNot(p: T => Boolean): Gen[T] = suchThat(x => !p(x))
10197

102-
/** Create a new generator that fails if the specified partial function
103-
* is undefined for this generator's value, otherwise returns the result
104-
* of the partial function applied to this generator's value. */
105-
@deprecated("Empty generators are discouraged.", "1.14.0")
106-
def collect[U](pf: PartialFunction[T,U]): Gen[U] =
107-
flatMap { t => Gen.fromOption(pf.lift(t)) }
108-
10998
/** Creates a non-strict filtered version of this generator. */
11099
def withFilter(p: T => Boolean): WithFilter = new WithFilter(p)
111100

@@ -446,14 +435,6 @@ object Gen extends GenArities{
446435
val seed = seed0
447436
}
448437

449-
/** A generator that fails if the provided option value is undefined,
450-
* otherwise just returns the value. */
451-
@deprecated("Empty generators are discouraged.", "1.14.0")
452-
def fromOption[T](o: Option[T]): Gen[T] = o match {
453-
case Some(t) => const(t)
454-
case None => fail
455-
}
456-
457438
/** A generator that generates a random value in the given (inclusive)
458439
* range. If the range is invalid, the generator will not generate
459440
* any value. */
@@ -514,12 +495,6 @@ object Gen extends GenArities{
514495
gen { (p, seed) => h.doApply(p, seed) }
515496
}
516497

517-
/** Wraps a generator for later evaluation. The given parameter is
518-
* evaluated each time the wrapper generator is evaluated.
519-
* This has been deprecated in favor of [[org.scalacheck.Gen.delay]]. */
520-
@deprecated("Replaced with delay()", "1.13.0")
521-
def wrap[T](g: => Gen[T]): Gen[T] = delay(g)
522-
523498
/** Wraps a generator for later evaluation. The given parameter is
524499
* evaluated each time the wrapper generator is evaluated. */
525500
def delay[T](g: => Gen[T]): Gen[T] =

0 commit comments

Comments
 (0)