summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-03-22 18:22:49 +0000
committerMartin Odersky <odersky@gmail.com>2007-03-22 18:22:49 +0000
commit800ce668acb253c3d5e57b5230d913ad155a0f74 (patch)
treea7526664522ee11348087e5bb80957182b9ba17e /test/files
parent0196b0e057dcd62903b6635f53d2857ea182280a (diff)
downloadscala-800ce668acb253c3d5e57b5230d913ad155a0f74.tar.gz
scala-800ce668acb253c3d5e57b5230d913ad155a0f74.tar.bz2
scala-800ce668acb253c3d5e57b5230d913ad155a0f74.zip
modified sinsibility checks and test cases
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/bug193.check17
-rw-r--r--test/files/neg/bug193.scala (renamed from test/files/pos/bug193.scala)2
-rw-r--r--test/files/neg/checksensible.check10
-rw-r--r--test/files/neg/checksensible.scala7
-rw-r--r--test/files/run/bug441.check1
-rw-r--r--test/files/run/bug441.scala12
6 files changed, 33 insertions, 16 deletions
diff --git a/test/files/neg/bug193.check b/test/files/neg/bug193.check
new file mode 100644
index 0000000000..2b2e4485a5
--- /dev/null
+++ b/test/files/neg/bug193.check
@@ -0,0 +1,17 @@
+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/pos/bug193.scala b/test/files/neg/bug193.scala
index e055f8a324..f4ed3f4643 100644
--- a/test/files/pos/bug193.scala
+++ b/test/files/neg/bug193.scala
@@ -1,4 +1,4 @@
-// $Id$
+// $Id: bug193.scala 9110 2006-11-01 16:03:28 +0000 (Wed, 01 Nov 2006) mihaylov $
trait Test {
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check
index a4cf1cfe41..27d1baeebb 100644
--- a/test/files/neg/checksensible.check
+++ b/test/files/neg/checksensible.check
@@ -7,9 +7,11 @@ 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)
^
@@ -22,7 +24,11 @@ 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))
^
-checksensible.scala:20: warning: comparing values of types scala.Unit and scala.Int using `!=' will always yield true
+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
+ ^
+checksensible.scala:26: warning: comparing values of types scala.Unit and scala.Int using `!=' will always yield true
while((c = in.read) != -1) {
^
-9 warnings found
+10 warnings found
diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala
index 1a2c4425fd..23e968a6cf 100644
--- a/test/files/neg/checksensible.scala
+++ b/test/files/neg/checksensible.scala
@@ -12,6 +12,12 @@ object Test {
println(new Object == new Object)
println(new Array(1) != new Array(1))
+ val foo: Array[String] = Array("1","2","3");
+ if( foo.length == null ) // == 0 makes more sense, but still
+ Console.println("plante"); // this code leads to runtime crash
+ else
+ Console.println("plante pas");
+
def main(args: Array[String]) = {
val in = new FileInputStream(args(0))
@@ -23,4 +29,5 @@ object Test {
in.close
}
+
}
diff --git a/test/files/run/bug441.check b/test/files/run/bug441.check
deleted file mode 100644
index 607ee1a6b8..0000000000
--- a/test/files/run/bug441.check
+++ /dev/null
@@ -1 +0,0 @@
-plante pas
diff --git a/test/files/run/bug441.scala b/test/files/run/bug441.scala
deleted file mode 100644
index d90e872baa..0000000000
--- a/test/files/run/bug441.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-object Test extends Application {
-
- def bug() = {
- val foo: Array[String] = Array("1","2","3");
- if( foo.length == null ) // == 0 makes more sense, but still
- Console.println("plante"); // this code leads to runtime crash
- else
- Console.println("plante pas");
- }
-
- bug()
-}