|
1 | 1 | package org.geoscript.support.interval
|
2 | 2 |
|
3 |
| -import org.scalacheck._, Arbitrary.arbitrary, Prop._ |
| 3 | +import org.scalacheck.{Arbitrary, Gen} |
| 4 | +import Arbitrary.arbitrary |
| 5 | +import org.scalatest._, prop._ |
4 | 6 |
|
5 |
| -object IntervalCheck extends Properties("Intervals") { |
| 7 | +class IntervalCheck extends PropSpec with Checkers { |
6 | 8 | import Interval.intersection
|
7 | 9 | val joinLeft = Cap.join[String](_ < _) _
|
8 | 10 |
|
@@ -32,23 +34,28 @@ object IntervalCheck extends Properties("Intervals") {
|
32 | 34 | Gen.oneOf(lefts, rights, finite, Interval.Empty[String], Interval.Full[String])
|
33 | 35 | }
|
34 | 36 |
|
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]) => |
37 | 39 | val joined = joinLeft(x, y)
|
38 | 40 | joined == x || joined == y
|
39 | 41 | }
|
| 42 | + } |
40 | 43 |
|
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]) => |
43 | 46 | intersection(x, Interval.Empty) == Interval.Empty
|
44 | 47 | }
|
| 48 | + } |
45 | 49 |
|
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 | + } |
48 | 53 |
|
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 | + } |
51 | 57 |
|
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 | + } |
54 | 61 | }
|
0 commit comments