diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-24 15:33:28 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-24 15:33:28 -0700 |
commit | 07a0b702ab00223f6f849868f0982cdb7994af66 (patch) | |
tree | b6af2156d381316d29c94b600e4b17d36dd7eb60 /test/files/run | |
parent | 811be49d3e9a45ef95df6132754e11360b19d917 (diff) | |
parent | 1b152ddb45ae3c60039fd16648b36d338caf8208 (diff) | |
download | scala-07a0b702ab00223f6f849868f0982cdb7994af66.tar.gz scala-07a0b702ab00223f6f849868f0982cdb7994af66.tar.bz2 scala-07a0b702ab00223f6f849868f0982cdb7994af66.zip |
Merge pull request #1190 from axel22/issue/6052-2.10.x
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) +} |