From b846a6a74164c29f8ea34eafd73aef29f9afc4e3 Mon Sep 17 00:00:00 2001 From: David MacIver Date: Sat, 25 Oct 2008 12:22:55 +0000 Subject: Added some more tests to check edge cases of ma... Added some more tests to check edge cases of matching on numeric literals. --- test/files/run/matchbytes.check | 1 + test/files/run/matchbytes.scala | 7 +++++++ test/files/run/matchintasany.check | 1 + test/files/run/matchintasany.scala | 8 ++++++++ 4 files changed, 17 insertions(+) create mode 100644 test/files/run/matchbytes.check create mode 100644 test/files/run/matchbytes.scala create mode 100644 test/files/run/matchintasany.check create mode 100644 test/files/run/matchintasany.scala (limited to 'test/files') 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("????"); + } +} -- cgit v1.2.3