blob: e740f00e16d0d391253dc8818d4e59ced6fe40e6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
}
|