summaryrefslogtreecommitdiff
path: root/test/pending
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2006-11-29 18:05:55 +0000
committerBurak Emir <emir@epfl.ch>2006-11-29 18:05:55 +0000
commit78db4cf7fe84fe2431fd8204a84d385e0fe8141d (patch)
tree9f8339df6e22e7cf9c91987ae717fcf34db6f315 /test/pending
parent10213bc9e7c1743f90b677b7f1bf45920f95fcf3 (diff)
downloadscala-78db4cf7fe84fe2431fd8204a84d385e0fe8141d.tar.gz
scala-78db4cf7fe84fe2431fd8204a84d385e0fe8141d.tar.bz2
scala-78db4cf7fe84fe2431fd8204a84d385e0fe8141d.zip
testcase for killoption
Diffstat (limited to 'test/pending')
-rw-r--r--test/pending/run/testSome.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/pending/run/testSome.scala b/test/pending/run/testSome.scala
new file mode 100644
index 0000000000..ee5e807151
--- /dev/null
+++ b/test/pending/run/testSome.scala
@@ -0,0 +1,22 @@
+object testSome {
+
+ val x: Option[String] = Some("foo")
+
+ val x1: Option[Int] = Some(3)
+
+ val y: Option[String] = None
+
+ val y1: Option[Int] = None
+
+
+ Console.println(x.isEmpty) // x ne null
+
+ Console.println(x1.isEmpty)
+
+ Console.println(x.get) // x
+
+ Console.println(x1.get)
+
+ def f(x:String) = Some(x)
+ x.flatMap(&f)
+}