diff options
author | Lex Spoon <lex@lexspoon.org> | 2008-03-09 14:58:33 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2008-03-09 14:58:33 +0000 |
commit | d817beea39b06c0b55fee8fa2b847b30dbe7c8c7 (patch) | |
tree | 8aff8f81864e73f5a3b54e25b4abce267f213bdb /test/files/run/arrays.scala | |
parent | 6131229601dd780870c524a870491930ae57d7f9 (diff) | |
download | scala-d817beea39b06c0b55fee8fa2b847b30dbe7c8c7.tar.gz scala-d817beea39b06c0b55fee8fa2b847b30dbe7c8c7.tar.bz2 scala-d817beea39b06c0b55fee8fa2b847b30dbe7c8c7.zip |
Array.zip supports arrays of different lengths.
Diffstat (limited to 'test/files/run/arrays.scala')
-rw-r--r-- | test/files/run/arrays.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/arrays.scala b/test/files/run/arrays.scala index 5fcc5e6614..927112d851 100644 --- a/test/files/run/arrays.scala +++ b/test/files/run/arrays.scala @@ -336,6 +336,14 @@ object Test { } //########################################################################## + // Miscellaneous checks + def checkZip(): Unit = { + val zipped = Array("a", "b", "c").zip(Array(1, 2)) + val expected = Array(("a",1), ("b",2)) + check(zipped sameElements expected, zipped.toList, expected.toList) + } + + //########################################################################## // Arrays val uarray: Array[Unit ] = Array(u0, u1); @@ -903,6 +911,10 @@ object Test { //###################################################################### + checkZip() + + //###################################################################### + println("checks: " + checks) //###################################################################### |