summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorDavid MacIver <david.maciver@gmail.com>2008-10-25 12:22:55 +0000
committerDavid MacIver <david.maciver@gmail.com>2008-10-25 12:22:55 +0000
commitb846a6a74164c29f8ea34eafd73aef29f9afc4e3 (patch)
tree8ec5b02c51ac8ca198c596223f71191a8e4d1aa3 /test/files
parent98abb80c3cd862d81fe41ea299b96f44f5de91d3 (diff)
downloadscala-b846a6a74164c29f8ea34eafd73aef29f9afc4e3.tar.gz
scala-b846a6a74164c29f8ea34eafd73aef29f9afc4e3.tar.bz2
scala-b846a6a74164c29f8ea34eafd73aef29f9afc4e3.zip
Added some more tests to check edge cases of ma...
Added some more tests to check edge cases of matching on numeric literals.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/matchbytes.check1
-rw-r--r--test/files/run/matchbytes.scala7
-rw-r--r--test/files/run/matchintasany.check1
-rw-r--r--test/files/run/matchintasany.scala8
4 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/matchbytes.check b/test/files/run/matchbytes.check
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/test/files/run/matchbytes.check
@@ -0,0 +1 @@
+1
diff --git a/test/files/run/matchbytes.scala b/test/files/run/matchbytes.scala
new file mode 100644
index 0000000000..73e55d47cb
--- /dev/null
+++ b/test/files/run/matchbytes.scala
@@ -0,0 +1,7 @@
+object Test extends Application{
+ val x = (1 : Byte) match {
+ case 2 => println(2);
+ case 1 => println(1);
+ case _ => println("????");
+ }
+}
diff --git a/test/files/run/matchintasany.check b/test/files/run/matchintasany.check
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/test/files/run/matchintasany.check
@@ -0,0 +1 @@
+1
diff --git a/test/files/run/matchintasany.scala b/test/files/run/matchintasany.scala
new file mode 100644
index 0000000000..2c732b98b5
--- /dev/null
+++ b/test/files/run/matchintasany.scala
@@ -0,0 +1,8 @@
+object Test extends Application{
+ val x = (1 : Any) match {
+ case 0xFFFFFFFF00000001L => println("Oops, overflow!");
+ case 2L => println(2);
+ case 1L => println(1);
+ case _ => println("????");
+ }
+}