diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/matcharraytail.check | 2 | ||||
-rw-r--r-- | test/files/run/matcharraytail.scala | 7 | ||||
-rw-r--r-- | test/files/run/matchemptyarray.check | 1 | ||||
-rw-r--r-- | test/files/run/matchemptyarray.scala | 5 |
4 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/matcharraytail.check b/test/files/run/matcharraytail.check new file mode 100644 index 0000000000..049db39a07 --- /dev/null +++ b/test/files/run/matcharraytail.check @@ -0,0 +1,2 @@ +Array(foo, bar, baz) +Array(bar, baz) diff --git a/test/files/run/matcharraytail.scala b/test/files/run/matcharraytail.scala new file mode 100644 index 0000000000..cdd79acda3 --- /dev/null +++ b/test/files/run/matcharraytail.scala @@ -0,0 +1,7 @@ +object Test extends Application{ + Array("foo", "bar", "baz") match { + case x@Array("foo", bar @_*) => println(x.toString); println(bar.toString); + case Array(x, y, z) => println("shouldn't have fallen through"); + case _ => println("default case?!"); + } +} diff --git a/test/files/run/matchemptyarray.check b/test/files/run/matchemptyarray.check new file mode 100644 index 0000000000..815225fc64 --- /dev/null +++ b/test/files/run/matchemptyarray.check @@ -0,0 +1 @@ +Array() diff --git a/test/files/run/matchemptyarray.scala b/test/files/run/matchemptyarray.scala new file mode 100644 index 0000000000..63abf74b65 --- /dev/null +++ b/test/files/run/matchemptyarray.scala @@ -0,0 +1,5 @@ +object Test extends Application{ + Array[String]() match { + case x@Array() => println(x.toString()); + } +} |