aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t6052.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/t6052.scala')
-rw-r--r--tests/run/t6052.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/run/t6052.scala b/tests/run/t6052.scala
new file mode 100644
index 000000000..e740f00e1
--- /dev/null
+++ b/tests/run/t6052.scala
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+object Test extends dotty.runtime.LegacyApp {
+ def seqarr(i: Int) = Array[Int]() ++ (0 until i)
+ def pararr(i: Int) = seqarr(i).par
+
+ def check[T](i: Int, f: Int => T): Unit = {
+ 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)
+}