From 5953fca1fe8c7260b99cea8a86bdf8439b48ffc2 Mon Sep 17 00:00:00 2001 From: Gilles Dubochet Date: Wed, 25 Jan 2006 15:19:16 +0000 Subject: 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). --- test/files/run/bugs.check | 5 ++--- test/files/run/bugs.scala | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'test') 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"); + } () } } -- cgit v1.2.3