diff options
author | Aleksandar Prokopec <axel22@gmail.com> | 2012-07-10 18:05:26 +0200 |
---|---|---|
committer | Aleksandar Prokopec <axel22@gmail.com> | 2012-08-24 19:43:32 +0200 |
commit | 1b152ddb45ae3c60039fd16648b36d338caf8208 (patch) | |
tree | b6af2156d381316d29c94b600e4b17d36dd7eb60 /test/files/run | |
parent | 811be49d3e9a45ef95df6132754e11360b19d917 (diff) | |
download | scala-1b152ddb45ae3c60039fd16648b36d338caf8208.tar.gz scala-1b152ddb45ae3c60039fd16648b36d338caf8208.tar.bz2 scala-1b152ddb45ae3c60039fd16648b36d338caf8208.zip |
SI-6052 - fix groupBy on parallel collections
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t6052.scala | 21 |
1 files changed, 21 insertions, 0 deletions
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) +} |