summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-02-04 20:40:54 +0000
committerpaltherr <paltherr@epfl.ch>2004-02-04 20:40:54 +0000
commit7c34b692599e036b847c871a9573066c1a87733a (patch)
tree52078e80a02278a8f1776b2f819f422710b6dd46 /test/files
parent24e7b23949904864117a81611319ef8ec86f9026 (diff)
downloadscala-7c34b692599e036b847c871a9573066c1a87733a.tar.gz
scala-7c34b692599e036b847c871a9573066c1a87733a.tar.bz2
scala-7c34b692599e036b847c871a9573066c1a87733a.zip
- Added isInstanceOf and asInstanceOf tests
Diffstat (limited to 'test/files')
-rw-r--r--test/files/shl/basic.check6
-rw-r--r--test/files/shl/basic.scala5
2 files changed, 11 insertions, 0 deletions
diff --git a/test/files/shl/basic.check b/test/files/shl/basic.check
index 2a4cd09b49..9439e81b3b 100644
--- a/test/files/shl/basic.check
+++ b/test/files/shl/basic.check
@@ -34,5 +34,11 @@ length(Nil)
}
> val p1: $console$25.Point = Point(3,7)
> Point(10,10): $console$25.Point
+> > true: scala.Boolean
+> false: scala.Boolean
+> string: java.lang.String("string")
+> Exception in thread "main" java.lang.ClassCastException: class java.lang.String is not an instance of class scala.Int
+ at $console$31.$console$31(<console>:1)
+ at <root>.$console$31(<console>:1)
> > >
[Leaving scalarun]
diff --git a/test/files/shl/basic.scala b/test/files/shl/basic.scala
index 4b0841f5e6..5d1264e901 100644
--- a/test/files/shl/basic.scala
+++ b/test/files/shl/basic.scala
@@ -38,4 +38,9 @@ class Point(x: Int, y: Int) {
val p1 = new Point(3,7)
p1.move(7,3)
+"string".isInstanceOf[String]
+"string".isInstanceOf[Int]
+"string".asInstanceOf[String]
+"string".asInstanceOf[Int]
+
//############################################################################