From d858fc14ad79b9c8bbe066aec70ded8fa62b0275 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 3 Jul 2011 19:52:51 +0000 Subject: Logic bug in repl :paste parsing, no review. --- test/files/run/repl-paste-3.check | 14 ++++++++++++++ test/files/run/repl-paste-3.scala | 8 ++++++++ test/files/run/repl-paste.check | 22 +++++++++++----------- test/files/run/repl-paste.scala | 20 ++++++++++---------- 4 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 test/files/run/repl-paste-3.check create mode 100644 test/files/run/repl-paste-3.scala (limited to 'test') diff --git a/test/files/run/repl-paste-3.check b/test/files/run/repl-paste-3.check new file mode 100644 index 0000000000..2b4c941c33 --- /dev/null +++ b/test/files/run/repl-paste-3.check @@ -0,0 +1,14 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> println(3) +3 + +scala> List(1,2) +res1: List[Int] = List(1, 2) + +scala> + +scala> diff --git a/test/files/run/repl-paste-3.scala b/test/files/run/repl-paste-3.scala new file mode 100644 index 0000000000..3f26799ccb --- /dev/null +++ b/test/files/run/repl-paste-3.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +println(3) + List(1,2) + """ +} \ No newline at end of file diff --git a/test/files/run/repl-paste.check b/test/files/run/repl-paste.check index 50589433cd..d3e171fbfb 100644 --- a/test/files/run/repl-paste.check +++ b/test/files/run/repl-paste.check @@ -5,17 +5,17 @@ scala> :paste // Entering paste mode (ctrl-D to finish) - class Dingus - { - private val x = 5 - def y = Dingus.x * 2 - } - object Dingus - { - private val x = 55 - } - - val x = (new Dingus).y +class Dingus +{ + private val x = 5 + def y = Dingus.x * 2 +} +object Dingus +{ + private val x = 55 +} + +val x = (new Dingus).y // Exiting paste mode, now interpreting. diff --git a/test/files/run/repl-paste.scala b/test/files/run/repl-paste.scala index e2ebab1e45..5495505353 100644 --- a/test/files/run/repl-paste.scala +++ b/test/files/run/repl-paste.scala @@ -3,17 +3,17 @@ import scala.tools.partest.ReplTest object Test extends ReplTest { def code = ":paste\n" + ( """ - class Dingus - { - private val x = 5 - def y = Dingus.x * 2 - } - object Dingus - { - private val x = 55 - } +class Dingus +{ + private val x = 5 + def y = Dingus.x * 2 +} +object Dingus +{ + private val x = 55 +} - val x = (new Dingus).y +val x = (new Dingus).y """ ) } \ No newline at end of file -- cgit v1.2.3