From 1b152ddb45ae3c60039fd16648b36d338caf8208 Mon Sep 17 00:00:00 2001 From: Aleksandar Prokopec Date: Tue, 10 Jul 2012 18:05:26 +0200 Subject: SI-6052 - fix groupBy on parallel collections --- test/files/run/t6052.scala | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/files/run/t6052.scala (limited to 'test/files/run/t6052.scala') diff --git a/test/files/run/t6052.scala b/test/files/run/t6052.scala new file mode 100644 index 0000000000..385d5390d3 --- /dev/null +++ b/test/files/run/t6052.scala @@ -0,0 +1,21 @@ + + + + + + + +object Test extends App { + def seqarr(i: Int) = Array[Int]() ++ (0 until i) + def pararr(i: Int) = seqarr(i).par + + def check[T](i: Int, f: Int => T) { + val gseq = seqarr(i).toSeq.groupBy(f) + val gpar = pararr(i).groupBy(f) + assert(gseq == gpar, (gseq, gpar)) + } + + for (i <- 0 until 20) check(i, _ > 0) + for (i <- 0 until 20) check(i, _ % 2) + for (i <- 0 until 20) check(i, _ % 4) +} -- cgit v1.2.3