Test for Analysis split/merge.

Requires scalacheck generators for Analysis and its subobjects. These
may be useful for other tests in the future.

Also fixes a bug in RelationTest.
This commit is contained in:
Benjy 2013-10-13 22:27:10 -07:00
parent 6e0281fa1c
commit 41e96dbc66
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ object RelationTest extends Properties("Relation")
}
property("Groups correctly") = forAll { (entries: List[(Int, Double)], randomInt: Int) =>
val splitInto = randomInt % 10 + 1 // Split into 1-10 groups.
val splitInto = math.abs(randomInt) % 10 + 1 // Split into 1-10 groups.
val rel = Relation.empty[Int, Double] ++ entries
val grouped = rel groupBy (_._1 % splitInto)
all(grouped.toSeq) {