diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/repl/import.check | 11 | ||||
-rw-r--r-- | tests/repl/multilines.check | 33 | ||||
-rw-r--r-- | tests/repl/onePlusOne.check | 3 |
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/repl/import.check b/tests/repl/import.check new file mode 100644 index 000000000..ccaa52190 --- /dev/null +++ b/tests/repl/import.check @@ -0,0 +1,11 @@ +scala> import collection.mutable._ +import collection.mutable._ +scala> val buf = new ListBuffer[Int] +buf: scala.collection.mutable.ListBuffer[Int] = ListBuffer() +scala> buf += 22 +res0: scala.collection.mutable.ListBuffer[Int] = ListBuffer(22) +scala> buf ++= List(1, 2, 3) +res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(22, 1, 2, 3) +scala> buf.toList +res2: scala.collection.immutable.List[Int] = List(22, 1, 2, 3) +scala> :quit diff --git a/tests/repl/multilines.check b/tests/repl/multilines.check new file mode 100644 index 000000000..3bc32707e --- /dev/null +++ b/tests/repl/multilines.check @@ -0,0 +1,33 @@ +scala> val x = """alpha + | + | omega""" +x: String = +alpha + +omega +scala> val y = """abc + | |def + | |ghi + | """.stripMargin +y: String = +abc +def +ghi + +scala> val z = { + | def square(x: Int) = x * x + | val xs = List(1, 2, 3) + | square(xs) + | } +<console>:8: error: type mismatch: + found : scala.collection.immutable.List[Int](xs) + required: Int + square(xs) + ^ +scala> val z = { + | def square(x: Int) = x * x + | val xs = List(1, 2, 3) + | xs.map(square) + | } +z: scala.collection.immutable.List[Int] = List(1, 4, 9) +scala> :quit diff --git a/tests/repl/onePlusOne.check b/tests/repl/onePlusOne.check new file mode 100644 index 000000000..9db6e6817 --- /dev/null +++ b/tests/repl/onePlusOne.check @@ -0,0 +1,3 @@ +scala> 1+1 +res0: Int = 2 +scala> :quit |