From 41e96dbc66f0952ecfd632083208e3bdda4810cb Mon Sep 17 00:00:00 2001 From: Benjy Date: Sun, 13 Oct 2013 22:27:10 -0700 Subject: [PATCH] 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. --- util/relation/src/test/scala/RelationTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/relation/src/test/scala/RelationTest.scala b/util/relation/src/test/scala/RelationTest.scala index de63fe893..03b728915 100644 --- a/util/relation/src/test/scala/RelationTest.scala +++ b/util/relation/src/test/scala/RelationTest.scala @@ -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) {