diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2006-01-25 15:19:16 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2006-01-25 15:19:16 +0000 |
commit | 5953fca1fe8c7260b99cea8a86bdf8439b48ffc2 (patch) | |
tree | c53da1a04f7ab2b6d4202347d4187cf5f95ad38d | |
parent | f8336becda846408925611fc0fb417243b88b824 (diff) | |
download | scala-5953fca1fe8c7260b99cea8a86bdf8439b48ffc2.tar.gz scala-5953fca1fe8c7260b99cea8a86bdf8439b48ffc2.tar.bz2 scala-5953fca1fe8c7260b99cea8a86bdf8439b48ffc2.zip |
Made 'bugs' test case more resistant to differe...
Made 'bugs' test case more resistant to differences between Java 1.4 and
1.5 (difference in reporting of class cast exceptions).
-rw-r--r-- | test/files/run/bugs.check | 5 | ||||
-rw-r--r-- | test/files/run/bugs.scala | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/test/files/run/bugs.check b/test/files/run/bugs.check index 206d0e9e48..1276cbbcc0 100644 --- a/test/files/run/bugs.check +++ b/test/files/run/bugs.check @@ -44,7 +44,8 @@ ok >>> bug 199 <<< bug 213 -Exception in thread "Thread[main,5,main]" java.lang.ClassCastException +Cannot cast unit to All +Cannot cast empty string to AllRef >>> bug 213 <<< bug 217 @@ -93,5 +94,3 @@ C a >>> bug 399 - -1 error diff --git a/test/files/run/bugs.scala b/test/files/run/bugs.scala index 90711e7ad2..8d611dae6a 100644 --- a/test/files/run/bugs.scala +++ b/test/files/run/bugs.scala @@ -221,8 +221,18 @@ class Bug213Bar extends Bug213Foo { object Bug213Test { def main(args: Array[String]): Unit = { val foo: Bug213Foo = new Bug213Bar; - foo.testAll; - foo.testAllRef; + try { + foo.testAll; + } catch { + case e: java.lang.ClassCastException => + Console.println("Cannot cast unit to All"); + } + try { + foo.testAllRef; + } catch { + case e: java.lang.ClassCastException => + Console.println("Cannot cast empty string to AllRef"); + } () } } |