diff options
Diffstat (limited to 'test/files/run/collection-conversions.scala')
-rw-r--r-- | test/files/run/collection-conversions.scala | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/files/run/collection-conversions.scala b/test/files/run/collection-conversions.scala index b5c4d8e261..d842742230 100644 --- a/test/files/run/collection-conversions.scala +++ b/test/files/run/collection-conversions.scala @@ -1,6 +1,7 @@ import collection._ import mutable.Buffer import parallel.immutable.ParVector +import parallel.mutable.ParArray import reflect.ClassTag object Test { @@ -29,30 +30,33 @@ object Test { val testStream = Stream(1,2,3) val testArray = Array(1,2,3) val testParVector = ParVector(1,2,3) + val testParArray = ParArray(1,2,3) def testConversion[A: ClassTag](name: String, col: => GenTraversableOnce[A]): Unit = { val tmp = col println("-- Testing " + name + " ---") printResult("[Direct] Vector ", col.toVector, testVector) - printResult("[Copy] Vector ", col.convertTo[Vector], testVector) + printResult("[Copy] Vector ", col.to[Vector], testVector) printResult("[Direct] Buffer ", col.toBuffer, testBuffer) - printResult("[Copy] Buffer ", col.convertTo[Buffer], testBuffer) + printResult("[Copy] Buffer ", col.to[Buffer], testBuffer) printResult("[Direct] GenSeq ", col.toSeq, testGenSeq) - printResult("[Copy] GenSeq ", col.convertTo[GenSeq], testGenSeq) - printResult("[Copy] Seq ", col.convertTo[Seq], testSeq) + printResult("[Copy] GenSeq ", col.to[GenSeq], testGenSeq) + printResult("[Copy] Seq ", col.to[Seq], testSeq) printResult("[Direct] Stream ", col.toStream, testStream) - printResult("[Copy] Stream ", col.convertTo[Stream], testStream) + printResult("[Copy] Stream ", col.to[Stream], testStream) printResult("[Direct] Array ", col.toArray, testArray) - printResult("[Copy] Array ", col.convertTo[Array], testArray) - printResult("[Copy] ParVector", col.convertTo[ParVector], testParVector) + printResult("[Copy] Array ", col.to[Array], testArray) + printResult("[Copy] ParVector", col.to[ParVector], testParVector) + printResult("[Copy] ParArray ", col.to[ParArray], testParArray) } def main(args: Array[String]): Unit = { - testConversion("iterator", (1 to 3).iterator) + testConversion("iterator", (1 to 3).iterator) testConversion("Vector", Vector(1,2,3)) testConversion("List", List(1,2,3)) testConversion("Buffer", Buffer(1,2,3)) testConversion("ParVector", ParVector(1,2,3)) + testConversion("ParArray", ParArray(1,2,3)) testConversion("Set", Set(1,2,3)) testConversion("SetView", Set(1,2,3).view) testConversion("BufferView", Buffer(1,2,3).view) |