aboutsummaryrefslogblamecommitdiff
path: root/tests/run/t6052.scala
blob: e740f00e16d0d391253dc8818d4e59ced6fe40e6 (plain) (tree)
1
2
3
4
5
6
7
8






 
                                             








                                                  


                                       
 
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)
}