diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-06-01 09:51:33 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-06-01 09:51:33 +0200 |
commit | 90215ce2b9cb99b5dea7c0ef474eea50755c0a40 (patch) | |
tree | 291b6c18bce82614411a14be77bda80844c7350c /test | |
parent | 971f5abc37538e1c4e7f0eef6b175f7951634e86 (diff) | |
parent | b462e5a97b499bc91222014e45ec2439f56b46b7 (diff) | |
download | scala-90215ce2b9cb99b5dea7c0ef474eea50755c0a40.tar.gz scala-90215ce2b9cb99b5dea7c0ef474eea50755c0a40.tar.bz2 scala-90215ce2b9cb99b5dea7c0ef474eea50755c0a40.zip |
Merge pull request #4998 from som-snytt/issue/7898-i
SI-7898 Read user input during REPL warmup
Diffstat (limited to 'test')
-rwxr-xr-x | test/files/run/repl-paste-parse.check | 6 | ||||
-rw-r--r-- | test/files/run/repl-paste-parse.scala | 27 | ||||
-rw-r--r-- | test/files/run/repl-paste-parse.script | 1 | ||||
-rw-r--r-- | test/files/run/t7805-repl-i.check | 3 | ||||
-rw-r--r-- | test/files/run/t9170.scala | 2 |
5 files changed, 35 insertions, 4 deletions
diff --git a/test/files/run/repl-paste-parse.check b/test/files/run/repl-paste-parse.check new file mode 100755 index 0000000000..7b2148dc74 --- /dev/null +++ b/test/files/run/repl-paste-parse.check @@ -0,0 +1,6 @@ +Type in expressions for evaluation. Or try :help. + +scala> repl-paste-parse.script:1: error: illegal start of simple pattern +val case = 9 + ^ +:quit diff --git a/test/files/run/repl-paste-parse.scala b/test/files/run/repl-paste-parse.scala new file mode 100644 index 0000000000..e93ad4d02b --- /dev/null +++ b/test/files/run/repl-paste-parse.scala @@ -0,0 +1,27 @@ + +import java.io.{ BufferedReader, StringReader, StringWriter, PrintWriter } + +import scala.tools.partest.DirectTest +import scala.tools.nsc.interpreter.ILoop +import scala.tools.nsc.GenericRunnerSettings + +object Test extends DirectTest { + override def extraSettings = s"-usejavacp -i $scriptPath" + def scriptPath = testPath.changeExtension("script") + override def newSettings(args: List[String]) = { + val ss = new GenericRunnerSettings(Console.println) + ss.processArguments(args, true) + ss + } + def code = "" + def show() = { + val r = new BufferedReader(new StringReader("")) + val w = new StringWriter + val p = new PrintWriter(w, true) + new ILoop(r, p).process(settings) + w.toString.lines foreach { s => + if (!s.startsWith("Welcome to Scala")) println(s) + } + } +} + diff --git a/test/files/run/repl-paste-parse.script b/test/files/run/repl-paste-parse.script new file mode 100644 index 0000000000..903f6e7b0c --- /dev/null +++ b/test/files/run/repl-paste-parse.script @@ -0,0 +1 @@ +val case = 9 diff --git a/test/files/run/t7805-repl-i.check b/test/files/run/t7805-repl-i.check index 24512c0067..70f024605c 100644 --- a/test/files/run/t7805-repl-i.check +++ b/test/files/run/t7805-repl-i.check @@ -1,6 +1,3 @@ -Loading t7805-repl-i.script... -import util._ - Welcome to Scala Type in expressions for evaluation. Or try :help. diff --git a/test/files/run/t9170.scala b/test/files/run/t9170.scala index f39467bc25..87471fb129 100644 --- a/test/files/run/t9170.scala +++ b/test/files/run/t9170.scala @@ -44,7 +44,7 @@ object Y { // Exiting paste mode, now interpreting. -<console>:13: error: double definition: +<pastie>:13: error: double definition: def f[A](a: => A): Int at line 12 and def f[A](a: => Either[Exception,A]): Int at line 13 have same type after erasure: (a: Function0)Int |