aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/t7747-repl.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
commit89bacb9c25a58454ff1878e67f7ea07ffc8c269f (patch)
tree51f1ff6c66aebe1b6109b1cffcc2bb8e4cf760a3 /tests/pending/run/t7747-repl.scala
parenta0fa33deafbea1bf53edc068c5ed9db5592822f9 (diff)
downloaddotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.gz
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.bz2
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.zip
Run tests as they were in scala.
Diffstat (limited to 'tests/pending/run/t7747-repl.scala')
-rw-r--r--tests/pending/run/t7747-repl.scala69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/pending/run/t7747-repl.scala b/tests/pending/run/t7747-repl.scala
new file mode 100644
index 000000000..0e6421046
--- /dev/null
+++ b/tests/pending/run/t7747-repl.scala
@@ -0,0 +1,69 @@
+import scala.tools.partest.ReplTest
+import scala.tools.nsc.Settings
+
+object Test extends ReplTest {
+
+ override def transformSettings(s: Settings): Settings = {
+ s.Yreplclassbased.value = true
+ s
+ }
+
+ def code = """
+ |var x = 10
+ |var y = 11
+ |x = 12
+ |y = 13
+ |val z = x * y
+ |2 ; 3
+ |{ 2 ; 3 }
+ |5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
+ | 1 +
+ | 2 +
+ | 3 } ; bippy+88+11
+ |
+ |object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy
+ |Bovine.x = List(Ruminant(5), Cow, new Moo)
+ |Bovine.x
+ |
+ |(2)
+ |(2 + 2)
+ |((2 + 2))
+ | ((2 + 2))
+ | ( (2 + 2))
+ | ( (2 + 2 ) )
+ |5 ; ( (2 + 2 ) ) ; ((5))
+ |(((2 + 2)), ((2 + 2)))
+ |(((2 + 2)), ((2 + 2)), 2)
+ |(((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString)
+ |
+ |55 ; ((2 + 2)) ; (1, 2, 3)
+ |55 ; (x: Int) => x + 1 ; () => ((5))
+ |
+ |() => 5
+ |55 ; () => 5
+ |() => { class X ; new X }
+ |
+ |def foo(x: Int)(y: Int)(z: Int) = x+y+z
+ |foo(5)(10)(15)+foo(5)(10)(15)
+ |
+ |List(1) ++ List('a')
+ |
+ |1 to 100 map (_ + 1)
+ |val x1 = 1
+ |val x2 = 2
+ |val x3 = 3
+ |case class BippyBungus()
+ |x1 + x2 + x3
+ |:reset
+ |x1 + x2 + x3
+ |val x1 = 4
+ |new BippyBungus
+ |class BippyBungus() { def f = 5 }
+ |{ new BippyBungus ; x1 }
+ |object x {class y { case object z } }
+ |case class BippyBups()
+ |case class PuppyPups()
+ |case class Bingo()
+ |List(BippyBups(), PuppyPups(), Bingo()) // show
+ |""".stripMargin
+}