Skip to content

Commit f9967f7

Browse files
committed
Port IntervalCheck to use the scalatest runner
1 parent 3da1be9 commit f9967f7

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

support/src/test/scala/org/geoscript/support/interval/IntervalCheck.scala

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package org.geoscript.support.interval
22

3-
import org.scalacheck._, Arbitrary.arbitrary, Prop._
3+
import org.scalacheck.{Arbitrary, Gen}
4+
import Arbitrary.arbitrary
5+
import org.scalatest._, prop._
46

5-
object IntervalCheck extends Properties("Intervals") {
7+
class IntervalCheck extends PropSpec with Checkers {
68
import Interval.intersection
79
val joinLeft = Cap.join[String](_ < _) _
810

@@ -32,23 +34,28 @@ object IntervalCheck extends Properties("Intervals") {
3234
Gen.oneOf(lefts, rights, finite, Interval.Empty[String], Interval.Full[String])
3335
}
3436

35-
property("join(x,y) always produces either x or y") =
36-
forAll { (x: Cap[String], y: Cap[String]) =>
37+
property("join(x,y) always produces either x or y") {
38+
check { (x: Cap[String], y: Cap[String]) =>
3739
val joined = joinLeft(x, y)
3840
joined == x || joined == y
3941
}
42+
}
4043

41-
property("Intersection with an empty interval produces an empty interval") =
42-
forAll { (x: Interval[String]) =>
44+
property("Intersection with an empty interval produces an empty interval") {
45+
check { (x: Interval[String]) =>
4346
intersection(x, Interval.Empty) == Interval.Empty
4447
}
48+
}
4549

46-
property("Intersection with full") =
47-
forAll { (x: Interval[String]) => intersection(x, Interval.Full[String]) == x }
50+
property("Intersection with full") {
51+
check { (x: Interval[String]) => intersection(x, Interval.Full[String]) == x }
52+
}
4853

49-
property("Intersection with self") =
50-
forAll { (x: Interval[String]) => intersection(x, x) == x }
54+
property("Intersection with self") {
55+
check { (x: Interval[String]) => intersection(x, x) == x }
56+
}
5157

52-
property("Intersection is commutative") =
53-
forAll { (x: Interval[String], y: Interval[String]) => intersection(x, y) == intersection(y, x) }
58+
property("Intersection is commutative") {
59+
check { (x: Interval[String], y: Interval[String]) => intersection(x, y) == intersection(y, x) }
60+
}
5461
}

0 commit comments

Comments
 (0)