10
10
package org .scalacheck
11
11
12
12
import java .math .BigInteger
13
- import java .math .{BigDecimal => JavaDecimal }
13
+ import java .math .{BigDecimal as JavaDecimal }
14
14
import java .util .Calendar
15
15
import java .util .UUID
16
16
import scala .annotation .tailrec
@@ -21,8 +21,8 @@ import scala.concurrent.duration.FiniteDuration
21
21
22
22
import rng .Seed
23
23
import util .Buildable
24
- import util .SerializableCanBuildFroms ._
25
- import ScalaVersionSpecific ._
24
+ import util .SerializableCanBuildFroms .*
25
+ import ScalaVersionSpecific .*
26
26
27
27
/** A generator produces values for [[Prop ]]s
28
28
*
@@ -1061,7 +1061,7 @@ object Gen extends GenArities with GenVersionSpecific {
1061
1061
1062
1062
/** A generator that picks a random number of elements from a list */
1063
1063
def someOf [T ](g1 : Gen [T ], g2 : Gen [T ], gs : Gen [T ]* ) =
1064
- choose(0 , gs.length + 2 ).flatMap(pick(_, g1, g2, gs : _ * ))
1064
+ choose(0 , gs.length + 2 ).flatMap(pick(_, g1, g2, gs* ))
1065
1065
1066
1066
/** A generator that picks at least one element from a list */
1067
1067
def atLeastOne [T ](l : Iterable [T ]) = {
@@ -1071,7 +1071,7 @@ object Gen extends GenArities with GenVersionSpecific {
1071
1071
1072
1072
/** A generator that picks at least one element from a list */
1073
1073
def atLeastOne [T ](g1 : Gen [T ], g2 : Gen [T ], gs : Gen [T ]* ) =
1074
- choose(1 , gs.length + 2 ).flatMap(pick(_, g1, g2, gs : _ * ))
1074
+ choose(1 , gs.length + 2 ).flatMap(pick(_, g1, g2, gs* ))
1075
1075
1076
1076
/** A generator that randomly picks a given number of elements from a list
1077
1077
*
@@ -1385,9 +1385,9 @@ object Gen extends GenArities with GenVersionSpecific {
1385
1385
/** Generates positive numbers of uniform distribution, with an upper bound of the generation size parameter.
1386
1386
*/
1387
1387
def posNum [T ](implicit num : Numeric [T ], c : Choose [T ]): Gen [T ] = {
1388
- import num ._
1388
+ import num .*
1389
1389
num match {
1390
- case _ : Fractional [_ ] => sized(n => c.choose(zero, max(fromInt(n), one)).suchThat(_ != zero))
1390
+ case _ : Fractional [? ] => sized(n => c.choose(zero, max(fromInt(n), one)).suchThat(_ != zero))
1391
1391
case _ => sized(n => c.choose(one, max(fromInt(n), one)))
1392
1392
}
1393
1393
}
@@ -1405,14 +1405,14 @@ object Gen extends GenArities with GenVersionSpecific {
1405
1405
num : Numeric [T ],
1406
1406
c : Choose [T ]
1407
1407
): Gen [T ] = {
1408
- import num ._
1408
+ import num .*
1409
1409
val basics = List (minT, maxT, zero, one, - one)
1410
1410
val basicsAndSpecials = for {
1411
1411
t <- specials ++ basics if t >= minT && t <= maxT
1412
1412
} yield (1 , const(t))
1413
1413
val other = (basicsAndSpecials.length, c.choose(minT, maxT))
1414
1414
val allGens = basicsAndSpecials :+ other
1415
- frequency(allGens : _ * )
1415
+ frequency(allGens* )
1416
1416
}
1417
1417
1418
1418
// // Misc Generators ////
@@ -1428,7 +1428,7 @@ object Gen extends GenArities with GenVersionSpecific {
1428
1428
)
1429
1429
1430
1430
lazy val calendar : Gen [Calendar ] = { // FIXME: Remove lazy
1431
- import Calendar ._
1431
+ import Calendar .*
1432
1432
1433
1433
def adjust (c : Calendar )(f : Calendar => Unit ): Calendar = { f(c); c }
1434
1434
0 commit comments