From 18bf6802667fcdef400f63c21a58fd532aa4a4a1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 22 Mar 2007 18:29:35 +0000 Subject: edited tests --- test/files/neg/bug193.check | 17 --------- test/files/neg/bug193.scala | 74 -------------------------------------- test/files/neg/checksensible.check | 7 ++-- test/files/neg/checksensible.scala | 4 ++- 4 files changed, 7 insertions(+), 95 deletions(-) delete mode 100644 test/files/neg/bug193.check delete mode 100644 test/files/neg/bug193.scala (limited to 'test') diff --git a/test/files/neg/bug193.check b/test/files/neg/bug193.check deleted file mode 100644 index 2b2e4485a5..0000000000 --- a/test/files/neg/bug193.check +++ /dev/null @@ -1,17 +0,0 @@ -actual = class Objectfalse -bug193.scala:39: warning: comparing values of types scala.Int and java.lang.Object using `==' will always yield false - (0 ) == y; - ^ -actual = class Objectfalse -bug193.scala:41: warning: comparing values of types scala.Int and java.lang.Object using `!=' will always yield true - (0 ) != y; - ^ -actual = class Objectfalse -bug193.scala:54: warning: comparing values of types scala.Int and java.lang.Object using `==' will always yield false - (x ) == y; - ^ -actual = class Objectfalse -bug193.scala:56: warning: comparing values of types scala.Int and java.lang.Object using `!=' will always yield true - (x ) != y; - ^ -four warnings found diff --git a/test/files/neg/bug193.scala b/test/files/neg/bug193.scala deleted file mode 100644 index f4ed3f4643..0000000000 --- a/test/files/neg/bug193.scala +++ /dev/null @@ -1,74 +0,0 @@ -// $Id: bug193.scala 9110 2006-11-01 16:03:28 +0000 (Wed, 01 Nov 2006) mihaylov $ - -trait Test { - - def fun_00(x: Int): Unit = { - (0: Any) == 0; - (0 ) == 0; - (0: Any) != 0; - (0 ) != 0; - () - } - - def fun_i0(x: Int): Unit = { - (x: Any) == 0; - (x ) == 0; - (x: Any) != 0; - (x ) != 0; - () - } - - def fun_o0(x: AnyRef): Unit = { - (x: Any) == 0; - (x ) == 0; - (x: Any) != 0; - (x ) != 0; - () - } - - def fun_0i(y: Int): Unit = { - (0: Any) == y; - (0 ) == y; - (0: Any) != y; - (0 ) != y; - () - } - - def fun_0o(y: AnyRef): Unit = { - (0: Any) == y; - (0 ) == y; - (0: Any) != y; - (0 ) != y; - () - } - - def fun_ii(x: Int, y: Int): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - def fun_io(x: Int, y: AnyRef): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - def fun_oi(x: AnyRef, y: Int): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - def fun_oo(x: AnyRef, y: AnyRef): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - -} diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 27d1baeebb..6ca462b528 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -1,3 +1,6 @@ +checksensible.scala:2: error: class Test needs to be abstract, since method isabstract is not defined +class Test { +^ checksensible.scala:4: warning: comparing values of types scala.Ordered[scala.Unit] and scala.Unit using `>' will always yield false println((c = 1) > 0) ^ @@ -7,11 +10,9 @@ checksensible.scala:5: warning: comparing values of types scala.Ordered[scala.Un checksensible.scala:6: warning: comparing values of types scala.Unit and scala.Int using `==' will always yield false println((c = 1) == 0) ^ -actual = class Stringfalse checksensible.scala:8: warning: comparing values of types scala.Int and java.lang.String using `==' will always yield false println(1 == "abc") ^ -actual = class Booleanfalse checksensible.scala:9: warning: comparing values of types scala.Int and scala.Boolean using `!=' will always yield true println(1 != true) ^ @@ -24,7 +25,6 @@ checksensible.scala:12: warning: comparing a fresh object using `==' will always checksensible.scala:13: warning: comparing a fresh object using `!=' will always yield true println(new Array(1) != new Array(1)) ^ -actual = trait Nullfalse checksensible.scala:16: warning: comparing values of types scala.Int and scala.Null using `==' will always yield false if( foo.length == null ) // == 0 makes more sense, but still ^ @@ -32,3 +32,4 @@ checksensible.scala:26: warning: comparing values of types scala.Unit and scala. while((c = in.read) != -1) { ^ 10 warnings found +one error found diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index 23e968a6cf..fa2655a241 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -1,5 +1,5 @@ import java.io._ -object Test { +class Test { var c = 0 println((c = 1) > 0) println((c = 1) <= 0) @@ -30,4 +30,6 @@ object Test { in.close } + def isabstract: int + } -- cgit v1.2.3