diff options
author | David MacIver <david.maciver@gmail.com> | 2008-10-26 15:55:23 +0000 |
---|---|---|
committer | David MacIver <david.maciver@gmail.com> | 2008-10-26 15:55:23 +0000 |
commit | 833c65eb0960bab1972e64a78a6389aff6845b71 (patch) | |
tree | bc5e36e86ad2c47e750efd5f54b9a5f944c3fbc7 /test/files/run | |
parent | ced4ddfef6b26f5aa84960289bb08c4cb883d071 (diff) | |
download | scala-833c65eb0960bab1972e64a78a6389aff6845b71.tar.gz scala-833c65eb0960bab1972e64a78a6389aff6845b71.tar.bz2 scala-833c65eb0960bab1972e64a78a6389aff6845b71.zip |
Cleaning up a lot of dead code from regular exp...
Cleaning up a lot of dead code from regular expression patterns. Added a
couple tests to verify correctness of cleanup.
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()); + } +} |