summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/Properties.scala8
-rw-r--r--src/library/scala/sys/BooleanProp.scala1
-rw-r--r--src/library/scala/sys/Prop.scala4
-rw-r--r--src/partest-extras/scala/tools/partest/ReplTest.scala34
-rw-r--r--src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala12
-rw-r--r--src/repl/scala/tools/nsc/interpreter/Formatting.scala3
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala27
-rw-r--r--src/repl/scala/tools/nsc/interpreter/IMain.scala4
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ReplProps.scala46
-rw-r--r--test/files/jvm/interpreter.check2
-rw-r--r--test/files/jvm/throws-annot-from-java.check2
-rw-r--r--test/files/jvm/xml05.check2
-rw-r--r--test/files/run/class-symbol-contravariant.check2
-rw-r--r--test/files/run/constant-type.check2
-rw-r--r--test/files/run/constrained-types.check2
-rw-r--r--test/files/run/kind-repl-command.check2
-rw-r--r--test/files/run/lub-visibility.check2
-rw-r--r--test/files/run/macro-bundle-repl.check2
-rw-r--r--test/files/run/macro-repl-basic.check2
-rw-r--r--test/files/run/macro-repl-dontexpand.check2
-rw-r--r--test/files/run/macro-system-properties.check2
-rw-r--r--test/files/run/reflection-equality.check2
-rw-r--r--test/files/run/reflection-magicsymbols-repl.check2
-rw-r--r--test/files/run/reflection-repl-classes.check2
-rw-r--r--test/files/run/reflection-repl-elementary.check2
-rw-r--r--test/files/run/reify-repl-fail-gracefully.check2
-rw-r--r--test/files/run/reify_newimpl_22.check2
-rw-r--r--test/files/run/reify_newimpl_23.check2
-rw-r--r--test/files/run/reify_newimpl_25.check2
-rw-r--r--test/files/run/reify_newimpl_26.check2
-rw-r--r--test/files/run/reify_newimpl_35.check2
-rw-r--r--test/files/run/repl-assign.check2
-rw-r--r--test/files/run/repl-bare-expr.check2
-rw-r--r--test/files/run/repl-colon-type.check2
-rw-r--r--test/files/run/repl-empty-package.check2
-rw-r--r--test/files/run/repl-javap-app.check9
-rw-r--r--test/files/run/repl-out-dir.check2
-rw-r--r--test/files/run/repl-parens.check2
-rw-r--r--test/files/run/repl-paste-2.check2
-rw-r--r--test/files/run/repl-paste-3.check2
-rw-r--r--test/files/run/repl-paste-4.scala4
-rw-r--r--test/files/run/repl-paste-raw.scala4
-rw-r--r--test/files/run/repl-paste.check2
-rw-r--r--test/files/run/repl-power.check2
-rw-r--r--test/files/run/repl-reset.check2
-rw-r--r--test/files/run/repl-save.scala4
-rw-r--r--test/files/run/repl-term-macros.check2
-rw-r--r--test/files/run/repl-transcript.check2
-rw-r--r--test/files/run/repl-trim-stack-trace.scala4
-rw-r--r--test/files/run/repl-type-verbose.check2
-rw-r--r--test/files/run/t3376.check2
-rw-r--r--test/files/run/t4025.check2
-rw-r--r--test/files/run/t4172.check2
-rw-r--r--test/files/run/t4216.check2
-rw-r--r--test/files/run/t4285.check2
-rw-r--r--test/files/run/t4542.check2
-rw-r--r--test/files/run/t4594-repl-settings.scala36
-rw-r--r--test/files/run/t4671.check2
-rw-r--r--test/files/run/t4710.check2
-rw-r--r--test/files/run/t4950.check2
-rw-r--r--test/files/run/t5072.check2
-rw-r--r--test/files/run/t5256d.check2
-rw-r--r--test/files/run/t5535.check2
-rw-r--r--test/files/run/t5537.check2
-rw-r--r--test/files/run/t5583.check2
-rw-r--r--test/files/run/t5655.check2
-rw-r--r--test/files/run/t5789.check2
-rw-r--r--test/files/run/t6086-repl.check2
-rw-r--r--test/files/run/t6146b.check2
-rw-r--r--test/files/run/t6187.check2
-rw-r--r--test/files/run/t6273.check2
-rw-r--r--test/files/run/t6320.check2
-rw-r--r--test/files/run/t6329_repl.check2
-rw-r--r--test/files/run/t6329_repl_bug.check2
-rw-r--r--test/files/run/t6381.check2
-rw-r--r--test/files/run/t6434.check2
-rw-r--r--test/files/run/t6439.check2
-rw-r--r--test/files/run/t6502.scala76
-rw-r--r--test/files/run/t6507.check4
-rw-r--r--test/files/run/t6549.check2
-rw-r--r--test/files/run/t6937.check2
-rw-r--r--test/files/run/t7185.check2
-rw-r--r--test/files/run/t7319.check2
-rw-r--r--test/files/run/t7482a.check2
-rw-r--r--test/files/run/t7634.check2
-rw-r--r--test/files/run/t7747-repl.check2
-rw-r--r--test/files/run/t7801.check2
-rw-r--r--test/files/run/t7805-repl-i.check3
-rw-r--r--test/files/run/t8843-repl-xlat.scala4
-rw-r--r--test/files/run/t9170.scala4
-rw-r--r--test/files/run/t9206.scala4
-rw-r--r--test/files/run/tpeCache-tyconCache.check2
-rw-r--r--test/files/run/xMigration.check2
93 files changed, 174 insertions, 265 deletions
diff --git a/src/compiler/scala/tools/nsc/Properties.scala b/src/compiler/scala/tools/nsc/Properties.scala
index ca7d8776d4..cb523edfe5 100644
--- a/src/compiler/scala/tools/nsc/Properties.scala
+++ b/src/compiler/scala/tools/nsc/Properties.scala
@@ -12,8 +12,16 @@ object Properties extends scala.util.PropertiesTrait {
protected def pickJarBasedOn = classOf[Global]
// settings based on jar properties, falling back to System prefixed by "scala."
+
+ // messages to display at startup or prompt, format string with string parameters
+ // Scala version, Java version, JVM name
def residentPromptString = scalaPropOrElse("resident.prompt", "\nnsc> ")
def shellPromptString = scalaPropOrElse("shell.prompt", "%nscala> ")
+ def shellWelcomeString = scalaPropOrElse("shell.welcome",
+ """Welcome to Scala %1$#s (%3$s, Java %2$s).
+ |Type in expressions for evaluation. Or try :help.""".stripMargin
+ )
+
// message to display at EOF (which by default ends with
// a newline so as not to break the user's terminal)
def shellInterruptedString = scalaPropOrElse("shell.interrupted", f":quit$lineSeparator")
diff --git a/src/library/scala/sys/BooleanProp.scala b/src/library/scala/sys/BooleanProp.scala
index e5e4668edb..b0008b41fd 100644
--- a/src/library/scala/sys/BooleanProp.scala
+++ b/src/library/scala/sys/BooleanProp.scala
@@ -50,6 +50,7 @@ object BooleanProp {
def get: String = "" + value
val clear, enable, disable, toggle = ()
def option = if (isSet) Some(value) else None
+ //def or[T1 >: Boolean](alt: => T1): T1 = if (value) true else alt
protected def zero = false
}
diff --git a/src/library/scala/sys/Prop.scala b/src/library/scala/sys/Prop.scala
index 17ae8cb69c..52a3d89ecb 100644
--- a/src/library/scala/sys/Prop.scala
+++ b/src/library/scala/sys/Prop.scala
@@ -58,6 +58,10 @@ trait Prop[+T] {
*/
def option: Option[T]
+ // Do not open until 2.12.
+ //** This value if the property is set, an alternative value otherwise. */
+ //def or[T1 >: T](alt: => T1): T1
+
/** Removes the property from the underlying map.
*/
def clear(): Unit
diff --git a/src/partest-extras/scala/tools/partest/ReplTest.scala b/src/partest-extras/scala/tools/partest/ReplTest.scala
index 1fde2370d3..20dfe0eb16 100644
--- a/src/partest-extras/scala/tools/partest/ReplTest.scala
+++ b/src/partest-extras/scala/tools/partest/ReplTest.scala
@@ -6,8 +6,9 @@
package scala.tools.partest
import scala.tools.nsc.Settings
-import scala.tools.nsc.interpreter.ILoop
+import scala.tools.nsc.interpreter.{ ILoop, replProps }
import java.lang.reflect.{ Method => JMethod, Field => JField }
+import scala.util.matching.Regex
import scala.util.matching.Regex.Match
/** A class for testing repl code.
@@ -19,30 +20,33 @@ abstract class ReplTest extends DirectTest {
// final because we need to enforce the existence of a couple settings.
final override def settings: Settings = {
val s = super.settings
- // s.Yreplsync.value = true
s.Xnojline.value = true
transformSettings(s)
}
+ def normalize(s: String) = s
/** True for SessionTest to preserve session text. */
def inSession: Boolean = false
- /** True to preserve welcome text. */
+ /** True to preserve welcome header, eliding version number. */
def welcoming: Boolean = false
- lazy val welcome = "(Welcome to Scala) version .*".r
- def normalize(s: String) = s match {
- case welcome(w) => w
- case s => s
- }
- def unwelcoming(s: String) = s match {
- case welcome(w) => false
- case _ => true
- }
+ lazy val header = replProps.welcome
def eval() = {
val s = settings
log("eval(): settings = " + s)
- //ILoop.runForTranscript(code, s).lines drop 1 // not always first line
val lines = ILoop.runForTranscript(code, s, inSession = inSession).lines
- if (welcoming) lines map normalize
- else lines filter unwelcoming
+ (if (welcoming) {
+ val welcome = "(Welcome to Scala).*".r
+ //val welcome = Regex.quote(header.lines.next).r
+ //val version = "(.*version).*".r // version on separate line?
+ //var inHead = false
+ lines map {
+ //case s @ welcome() => inHead = true ; s
+ //case version(s) if inHead => inHead = false ; s
+ case welcome(s) => s
+ case s => s
+ }
+ } else {
+ lines drop header.lines.size
+ }) map normalize
}
def show() = eval() foreach println
}
diff --git a/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala b/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala
index b6c9792ec0..53a06ca972 100644
--- a/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala
+++ b/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala
@@ -7,9 +7,9 @@ package scala.tools.nsc.interpreter.jline
import _root_.jline.console.history.PersistentHistory
-
import scala.tools.nsc.interpreter
-import scala.tools.nsc.io.{File, Path}
+import scala.reflect.io.{ File, Path }
+import scala.tools.nsc.Properties.{ propOrNone, userHome }
/** TODO: file locking.
*/
@@ -85,9 +85,9 @@ object FileBackedHistory {
// val ContinuationChar = '\003'
// val ContinuationNL: String = Array('\003', '\n').mkString
- import scala.tools.nsc.Properties.userHome
-
- def defaultFileName = ".scala_history"
+ final val defaultFileName = ".scala_history"
- def defaultFile: File = File(Path(userHome) / defaultFileName)
+ def defaultFile: File = File(
+ propOrNone("scala.shell.histfile") map (Path.apply) getOrElse (Path(userHome) / defaultFileName)
+ )
}
diff --git a/src/repl/scala/tools/nsc/interpreter/Formatting.scala b/src/repl/scala/tools/nsc/interpreter/Formatting.scala
index 844997429c..4a9548730a 100644
--- a/src/repl/scala/tools/nsc/interpreter/Formatting.scala
+++ b/src/repl/scala/tools/nsc/interpreter/Formatting.scala
@@ -30,3 +30,6 @@ class Formatting(indent: Int) {
}
)
}
+object Formatting {
+ def forPrompt(prompt: String) = new Formatting(prompt.lines.toList.last.length)
+}
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index 525609171e..6470a450b2 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -56,13 +56,9 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
private var globalFuture: Future[Boolean] = _
- /** Print a welcome message */
- def printWelcome() {
- echo(s"""
- |Welcome to Scala $versionString ($javaVmName, Java $javaVersion).
- |Type in expressions to have them evaluated.
- |Type :help for more information.""".trim.stripMargin
- )
+ /** Print a welcome message! */
+ def printWelcome(): Unit = {
+ Option(replProps.welcome) filter (!_.isEmpty) foreach echo
replinfo("[info] started at " + new java.util.Date)
}
@@ -111,10 +107,6 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
}
class ILoopInterpreter extends IMain(settings, out) {
- // the expanded prompt but without color escapes and without leading newline, for purposes of indenting
- override lazy val formatting: Formatting = new Formatting(
- (replProps.promptString format Properties.versionNumberString).lines.toList.last.length
- )
override protected def parentClassLoader =
settings.explicitParentLoader.getOrElse( classOf[ILoop].getClassLoader )
}
@@ -680,9 +672,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
}
def verbosity() = {
- val old = intp.printResults
- intp.printResults = !old
- echo("Switched " + (if (old) "off" else "on") + " result printing.")
+ intp.printResults = !intp.printResults
+ replinfo(s"Result printing is ${ if (intp.printResults) "on" else "off" }.")
}
/** Run one command submitted by the user. Two values are returned:
@@ -762,7 +753,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
private object paste extends Pasted {
import scala.util.matching.Regex.quote
- val ContinueString = " | "
+ val ContinuePrompt = replProps.continuePrompt
+ val ContinueString = replProps.continueText // " | "
val PromptString = prompt.lines.toList.last
val anyPrompt = s"""\\s*(?:${quote(PromptString.trim)}|${quote(AltPromptString.trim)})\\s*""".r
@@ -806,7 +798,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
echo("You typed two blank lines. Starting a new command.")
None
case IR.Incomplete =>
- in.readLine(paste.ContinueString) match {
+ in.readLine(paste.ContinuePrompt) match {
case null =>
// we know compilation is going to fail since we're at EOF and the
// parser thinks the input is still incomplete, but since this is
@@ -949,8 +941,9 @@ object ILoop {
Console.withOut(ostream) {
val output = new JPrintWriter(new OutputStreamWriter(ostream), true) {
// skip margin prefix for continuation lines, unless preserving session text for test
+ // should test for repl.paste.ContinueString or replProps.continueText.contains(ch)
override def write(str: String) =
- if (!inSession && (str forall (ch => ch.isWhitespace || ch == '|'))) () // repl.paste.ContinueString
+ if (!inSession && (str forall (ch => ch.isWhitespace || ch == '|'))) ()
else super.write(str)
}
val input = new BufferedReader(new StringReader(code.trim + "\n")) {
diff --git a/src/repl/scala/tools/nsc/interpreter/IMain.scala b/src/repl/scala/tools/nsc/interpreter/IMain.scala
index 2550a5dc57..841b4abfa5 100644
--- a/src/repl/scala/tools/nsc/interpreter/IMain.scala
+++ b/src/repl/scala/tools/nsc/interpreter/IMain.scala
@@ -113,9 +113,7 @@ class IMain(@BeanProperty val factory: ScriptEngineFactory, initialSettings: Set
def this() = this(new Settings())
// the expanded prompt but without color escapes and without leading newline, for purposes of indenting
- lazy val formatting: Formatting = new Formatting(
- (replProps.promptString format Properties.versionNumberString).lines.toList.last.length
- )
+ lazy val formatting = Formatting.forPrompt(replProps.promptText)
lazy val reporter: ReplReporter = new ReplReporter(this)
import formatting.indentCode
diff --git a/src/repl/scala/tools/nsc/interpreter/ReplProps.scala b/src/repl/scala/tools/nsc/interpreter/ReplProps.scala
index df65e9974d..588d92f81b 100644
--- a/src/repl/scala/tools/nsc/interpreter/ReplProps.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ReplProps.scala
@@ -6,9 +6,11 @@
package scala.tools.nsc
package interpreter
-import Properties.shellPromptString
+import Properties.{ javaVersion, javaVmName, shellPromptString, shellWelcomeString,
+ versionString, versionNumberString }
import scala.sys._
import Prop._
+import java.util.{ Formattable, FormattableFlags, Formatter }
class ReplProps {
private def bool(name: String) = BooleanProp.keyExists(name)
@@ -22,12 +24,44 @@ class ReplProps {
val trace = bool("scala.repl.trace")
val power = bool("scala.repl.power")
- // Handy system prop for shell prompt, or else pick it up from compiler.properties
- val promptString = Prop[String]("scala.repl.prompt").option getOrElse (if (info) "%nscala %s> " else shellPromptString)
- val prompt = {
+ def enversion(s: String) = {
+ import FormattableFlags._
+ val v = new Formattable {
+ override def formatTo(formatter: Formatter, flags: Int, width: Int, precision: Int) = {
+ val version = if ((flags & ALTERNATE) != 0) versionNumberString else versionString
+ val left = if ((flags & LEFT_JUSTIFY) != 0) "-" else ""
+ val w = if (width >= 0) s"$width" else ""
+ val p = if (precision >= 0) s".$precision" else ""
+ val fmt = s"%${left}${w}${p}s"
+ formatter.format(fmt, version)
+ }
+ }
+ s.format(v, javaVersion, javaVmName)
+ }
+ def encolor(s: String) = {
import scala.io.AnsiColor.{ MAGENTA, RESET }
- val p = promptString format Properties.versionNumberString
- if (colorOk) s"$MAGENTA$p$RESET" else p
+ if (colorOk) s"$MAGENTA$s$RESET" else s
+ }
+
+ // Handy system prop for shell prompt, or else pick it up from compiler.properties
+ val promptString = Prop[String]("scala.repl.prompt").option getOrElse (if (info) "%nscala %#s> " else shellPromptString)
+ val promptText = enversion(promptString)
+ val prompt = encolor(promptText)
+
+ // Prompt for continued input, will be right-adjusted to width of the primary prompt
+ val continueString = Prop[String]("scala.repl.continue").option getOrElse "| "
+ val continueText = {
+ val text = enversion(continueString)
+ val margin = promptText.lines.toList.last.length - text.length
+ if (margin > 0) " " * margin + text else text
+ }
+ val continuePrompt = encolor(continueText)
+
+ // Next time.
+ //def welcome = enversion(Prop[String]("scala.repl.welcome") or shellWelcomeString)
+ def welcome = enversion {
+ val p = Prop[String]("scala.repl.welcome")
+ if (p.isSet) p.get else shellWelcomeString
}
/** CSV of paged,across to enable pagination or `-x` style
diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check
index 9e875235c7..08372685d6 100644
--- a/test/files/jvm/interpreter.check
+++ b/test/files/jvm/interpreter.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> // basics
diff --git a/test/files/jvm/throws-annot-from-java.check b/test/files/jvm/throws-annot-from-java.check
index c541b26fcc..ace264a4f5 100644
--- a/test/files/jvm/throws-annot-from-java.check
+++ b/test/files/jvm/throws-annot-from-java.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
diff --git a/test/files/jvm/xml05.check b/test/files/jvm/xml05.check
index cad907525d..d456c5e1e4 100644
--- a/test/files/jvm/xml05.check
+++ b/test/files/jvm/xml05.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> <city name="San Jos&eacute;"/>
res0: scala.xml.Elem = <city name="San Jos&eacute;"/>
diff --git a/test/files/run/class-symbol-contravariant.check b/test/files/run/class-symbol-contravariant.check
index cbb90b52c2..1d95273b50 100644
--- a/test/files/run/class-symbol-contravariant.check
+++ b/test/files/run/class-symbol-contravariant.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
diff --git a/test/files/run/constant-type.check b/test/files/run/constant-type.check
index a7ba5a46c2..b92f1481a3 100644
--- a/test/files/run/constant-type.check
+++ b/test/files/run/constant-type.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check
index 6dbf8088c9..670d6f49aa 100644
--- a/test/files/run/constrained-types.check
+++ b/test/files/run/constrained-types.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class Annot(obj: Any) extends annotation.Annotation with annotation.TypeConstraint
defined class Annot
diff --git a/test/files/run/kind-repl-command.check b/test/files/run/kind-repl-command.check
index 1853213555..e050fb4bc1 100644
--- a/test/files/run/kind-repl-command.check
+++ b/test/files/run/kind-repl-command.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :kind scala.Option
scala.Option's kind is F[+A]
diff --git a/test/files/run/lub-visibility.check b/test/files/run/lub-visibility.check
index 70734966f0..757f0f5917 100644
--- a/test/files/run/lub-visibility.check
+++ b/test/files/run/lub-visibility.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> // should infer List[scala.collection.immutable.Seq[Nothing]]
diff --git a/test/files/run/macro-bundle-repl.check b/test/files/run/macro-bundle-repl.check
index 75c5c2adda..ce5c980f6e 100644
--- a/test/files/run/macro-bundle-repl.check
+++ b/test/files/run/macro-bundle-repl.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.language.experimental.macros
import scala.language.experimental.macros
diff --git a/test/files/run/macro-repl-basic.check b/test/files/run/macro-repl-basic.check
index fab03d1558..7e1cb61583 100644
--- a/test/files/run/macro-repl-basic.check
+++ b/test/files/run/macro-repl-basic.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import language.experimental.macros
import language.experimental.macros
diff --git a/test/files/run/macro-repl-dontexpand.check b/test/files/run/macro-repl-dontexpand.check
index 6ecc9245fa..a307ffb26e 100644
--- a/test/files/run/macro-repl-dontexpand.check
+++ b/test/files/run/macro-repl-dontexpand.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> def bar1(c: scala.reflect.macros.blackbox.Context) = ???
bar1: (c: scala.reflect.macros.blackbox.Context)Nothing
diff --git a/test/files/run/macro-system-properties.check b/test/files/run/macro-system-properties.check
index e2e2bd32b9..e20a5bbdfb 100644
--- a/test/files/run/macro-system-properties.check
+++ b/test/files/run/macro-system-properties.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.language.experimental._, scala.reflect.macros.blackbox.Context
import scala.language.experimental._
diff --git a/test/files/run/reflection-equality.check b/test/files/run/reflection-equality.check
index d60d861a90..09a0858630 100644
--- a/test/files/run/reflection-equality.check
+++ b/test/files/run/reflection-equality.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class X {
def methodIntIntInt(x: Int, y: Int) = x+y
diff --git a/test/files/run/reflection-magicsymbols-repl.check b/test/files/run/reflection-magicsymbols-repl.check
index ca8857ada4..dd26c08349 100644
--- a/test/files/run/reflection-magicsymbols-repl.check
+++ b/test/files/run/reflection-magicsymbols-repl.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
diff --git a/test/files/run/reflection-repl-classes.check b/test/files/run/reflection-repl-classes.check
index 5ebf993a87..df889b9da6 100644
--- a/test/files/run/reflection-repl-classes.check
+++ b/test/files/run/reflection-repl-classes.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class A
defined class A
diff --git a/test/files/run/reflection-repl-elementary.check b/test/files/run/reflection-repl-elementary.check
index e948c9fd61..2a7f5d90fe 100644
--- a/test/files/run/reflection-repl-elementary.check
+++ b/test/files/run/reflection-repl-elementary.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> scala.reflect.runtime.universe.typeOf[List[Nothing]]
res0: reflect.runtime.universe.Type = scala.List[Nothing]
diff --git a/test/files/run/reify-repl-fail-gracefully.check b/test/files/run/reify-repl-fail-gracefully.check
index eac4d25869..025d377a43 100644
--- a/test/files/run/reify-repl-fail-gracefully.check
+++ b/test/files/run/reify-repl-fail-gracefully.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import language.experimental.macros
import language.experimental.macros
diff --git a/test/files/run/reify_newimpl_22.check b/test/files/run/reify_newimpl_22.check
index 24334df92c..e69dc60199 100644
--- a/test/files/run/reify_newimpl_22.check
+++ b/test/files/run/reify_newimpl_22.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
diff --git a/test/files/run/reify_newimpl_23.check b/test/files/run/reify_newimpl_23.check
index f8379958db..1356d509d3 100644
--- a/test/files/run/reify_newimpl_23.check
+++ b/test/files/run/reify_newimpl_23.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
diff --git a/test/files/run/reify_newimpl_25.check b/test/files/run/reify_newimpl_25.check
index f9a5d7b578..e512cfc52e 100644
--- a/test/files/run/reify_newimpl_25.check
+++ b/test/files/run/reify_newimpl_25.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> {
import scala.reflect.runtime.universe._
diff --git a/test/files/run/reify_newimpl_26.check b/test/files/run/reify_newimpl_26.check
index bd77d3d707..b203389db1 100644
--- a/test/files/run/reify_newimpl_26.check
+++ b/test/files/run/reify_newimpl_26.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> def foo[T]{
import scala.reflect.runtime.universe._
diff --git a/test/files/run/reify_newimpl_35.check b/test/files/run/reify_newimpl_35.check
index bd9b3a2fb1..4f9b43dbbf 100644
--- a/test/files/run/reify_newimpl_35.check
+++ b/test/files/run/reify_newimpl_35.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
diff --git a/test/files/run/repl-assign.check b/test/files/run/repl-assign.check
index faa8a93244..a9e0a2204a 100644
--- a/test/files/run/repl-assign.check
+++ b/test/files/run/repl-assign.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> var x = 10
x: Int = 10
diff --git a/test/files/run/repl-bare-expr.check b/test/files/run/repl-bare-expr.check
index 38ad7e818d..f0c488455f 100644
--- a/test/files/run/repl-bare-expr.check
+++ b/test/files/run/repl-bare-expr.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> 2 ; 3
<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
diff --git a/test/files/run/repl-colon-type.check b/test/files/run/repl-colon-type.check
index fa33af3beb..21fbe34d96 100644
--- a/test/files/run/repl-colon-type.check
+++ b/test/files/run/repl-colon-type.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :type List[1, 2, 3]
<console>:1: error: identifier expected but integer literal found.
diff --git a/test/files/run/repl-empty-package.check b/test/files/run/repl-empty-package.check
index d3b75f685e..69488ecdcf 100644
--- a/test/files/run/repl-empty-package.check
+++ b/test/files/run/repl-empty-package.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> println(Bippy.bippy)
bippy!
diff --git a/test/files/run/repl-javap-app.check b/test/files/run/repl-javap-app.check
index eb3718f44b..bace9534da 100644
--- a/test/files/run/repl-javap-app.check
+++ b/test/files/run/repl-javap-app.check
@@ -1,7 +1,6 @@
#partest java6
Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
+Type in expressions for evaluation. Or try :help.
scala> :javap -app MyApp$
public final void delayedEndpoint$MyApp$1();
@@ -18,8 +17,7 @@ public final void delayedEndpoint$MyApp$1();
scala> :quit
#partest java7
Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
+Type in expressions for evaluation. Or try :help.
scala> :javap -app MyApp$
public final void delayedEndpoint$MyApp$1();
@@ -40,8 +38,7 @@ scala> :javap -app MyApp$
scala> :quit
#partest java8
Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
+Type in expressions for evaluation. Or try :help.
scala> :javap -app MyApp$
public final void delayedEndpoint$MyApp$1();
diff --git a/test/files/run/repl-out-dir.check b/test/files/run/repl-out-dir.check
index c354492898..6fd85f5bba 100644
--- a/test/files/run/repl-out-dir.check
+++ b/test/files/run/repl-out-dir.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> case class Bippy(x: Int)
defined class Bippy
diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check
index 756a063b68..35853f10da 100644
--- a/test/files/run/repl-parens.check
+++ b/test/files/run/repl-parens.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> (2)
res0: Int = 2
diff --git a/test/files/run/repl-paste-2.check b/test/files/run/repl-paste-2.check
index bc80615107..5b6a84144d 100644
--- a/test/files/run/repl-paste-2.check
+++ b/test/files/run/repl-paste-2.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> scala> 999l
diff --git a/test/files/run/repl-paste-3.check b/test/files/run/repl-paste-3.check
index 23e402852f..603fcfa174 100644
--- a/test/files/run/repl-paste-3.check
+++ b/test/files/run/repl-paste-3.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> println(3)
3
diff --git a/test/files/run/repl-paste-4.scala b/test/files/run/repl-paste-4.scala
index cb0a6aa768..90f0c1802b 100644
--- a/test/files/run/repl-paste-4.scala
+++ b/test/files/run/repl-paste-4.scala
@@ -3,9 +3,7 @@ import scala.tools.partest.SessionTest
object Test extends SessionTest {
def session =
-s"""|Type in expressions to have them evaluated.
- |Type :help for more information.
- |
+s"""|
|scala> :paste $pastie
|Pasting file $pastie...
|defined class Foo
diff --git a/test/files/run/repl-paste-raw.scala b/test/files/run/repl-paste-raw.scala
index 3b41254e96..9bd5e8e63e 100644
--- a/test/files/run/repl-paste-raw.scala
+++ b/test/files/run/repl-paste-raw.scala
@@ -3,9 +3,7 @@ import scala.tools.partest.SessionTest
object Test extends SessionTest {
def session =
-s"""|Type in expressions to have them evaluated.
- |Type :help for more information.
- |
+s"""|
|scala> :paste -raw $pastie
|Pasting file $pastie...
|
diff --git a/test/files/run/repl-paste.check b/test/files/run/repl-paste.check
index 171447214f..3bcfd33c94 100644
--- a/test/files/run/repl-paste.check
+++ b/test/files/run/repl-paste.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :paste
// Entering paste mode (ctrl-D to finish)
diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check
index e2318c93f2..2a7b7783d9 100644
--- a/test/files/run/repl-power.check
+++ b/test/files/run/repl-power.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
diff --git a/test/files/run/repl-reset.check b/test/files/run/repl-reset.check
index a2d88fd445..b0683fff79 100644
--- a/test/files/run/repl-reset.check
+++ b/test/files/run/repl-reset.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val x1 = 1
x1: Int = 1
diff --git a/test/files/run/repl-save.scala b/test/files/run/repl-save.scala
index c98e6aebc3..8a3a887a8c 100644
--- a/test/files/run/repl-save.scala
+++ b/test/files/run/repl-save.scala
@@ -2,9 +2,7 @@ import scala.tools.partest.SessionTest
object Test extends SessionTest {
def session =
-s"""|Type in expressions to have them evaluated.
- |Type :help for more information.
- |
+s"""|
|scala> val i = 7
|i: Int = 7
|
diff --git a/test/files/run/repl-term-macros.check b/test/files/run/repl-term-macros.check
index 2cd0b93cd0..b020611167 100644
--- a/test/files/run/repl-term-macros.check
+++ b/test/files/run/repl-term-macros.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.macros.blackbox.Context
import scala.reflect.macros.blackbox.Context
diff --git a/test/files/run/repl-transcript.check b/test/files/run/repl-transcript.check
index b0f106387b..762a96b9cc 100644
--- a/test/files/run/repl-transcript.check
+++ b/test/files/run/repl-transcript.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> scala> class Bippity
diff --git a/test/files/run/repl-trim-stack-trace.scala b/test/files/run/repl-trim-stack-trace.scala
index b8c1668691..ea91e32239 100644
--- a/test/files/run/repl-trim-stack-trace.scala
+++ b/test/files/run/repl-trim-stack-trace.scala
@@ -5,8 +5,7 @@ import scala.tools.partest.{ SessionTest, Welcoming }
object Test extends SessionTest with Welcoming {
def session =
"""Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
+Type in expressions for evaluation. Or try :help.
scala> def f = throw new Exception("Uh-oh")
f: Nothing
@@ -37,7 +36,6 @@ scala> :quit"""
// normalize the "elided" lines because the frame count depends on test context
lazy val elided = """(\s+\.{3} )\d+( elided)""".r
override def normalize(line: String) = line match {
- case welcome(w) => w
case elided(ellipsis, suffix) => s"$ellipsis???$suffix"
case s => s
}
diff --git a/test/files/run/repl-type-verbose.check b/test/files/run/repl-type-verbose.check
index 6f6b47b86d..10a9c1217c 100644
--- a/test/files/run/repl-type-verbose.check
+++ b/test/files/run/repl-type-verbose.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> // verbose!
diff --git a/test/files/run/t3376.check b/test/files/run/t3376.check
index b8fd2843f6..0af54d6a53 100644
--- a/test/files/run/t3376.check
+++ b/test/files/run/t3376.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class M[@specialized T] { override def toString = "mmm" }
defined class M
diff --git a/test/files/run/t4025.check b/test/files/run/t4025.check
index e8c6851236..ed3f254024 100644
--- a/test/files/run/t4025.check
+++ b/test/files/run/t4025.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class Color(val red: Int)
defined class Color
diff --git a/test/files/run/t4172.check b/test/files/run/t4172.check
index 315c1c9dbd..3141647dba 100644
--- a/test/files/run/t4172.check
+++ b/test/files/run/t4172.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) }
warning: there was one feature warning; re-run with -feature for details
diff --git a/test/files/run/t4216.check b/test/files/run/t4216.check
index e4610e87d3..3ec394b939 100644
--- a/test/files/run/t4216.check
+++ b/test/files/run/t4216.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.ClassTag
import scala.reflect.ClassTag
diff --git a/test/files/run/t4285.check b/test/files/run/t4285.check
index b952cb8e1b..465aee75f1 100644
--- a/test/files/run/t4285.check
+++ b/test/files/run/t4285.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val x = Array(1,2,3,4,5,6,7)
x: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7)
diff --git a/test/files/run/t4542.check b/test/files/run/t4542.check
index f7aad3deb2..3ab3eaffd8 100644
--- a/test/files/run/t4542.check
+++ b/test/files/run/t4542.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> @deprecated("foooo", "ReplTest version 1.0-FINAL") class Foo() {
override def toString = "Bippy"
diff --git a/test/files/run/t4594-repl-settings.scala b/test/files/run/t4594-repl-settings.scala
index 1b883983cf..cbd87b5949 100644
--- a/test/files/run/t4594-repl-settings.scala
+++ b/test/files/run/t4594-repl-settings.scala
@@ -4,23 +4,21 @@ import scala.tools.partest.SessionTest
// Detected repl transcript paste: ctrl-D to finish.
object Test extends SessionTest {
def session =
-""" |Type in expressions to have them evaluated.
- |Type :help for more information.
- |
- |scala> @deprecated(message="Please don't do that.", since="Time began.") def depp = "john"
- |depp: String
- |
- |scala> def a = depp
- |warning: there was one deprecation warning; re-run with -deprecation for details
- |a: String
- |
- |scala> :settings -deprecation
- |
- |scala> def b = depp
- |<console>:11: warning: method depp is deprecated: Please don't do that.
- | def b = depp
- | ^
- |b: String
- |
- |scala> :quit"""
+"""|
+ |scala> @deprecated(message="Please don't do that.", since="Time began.") def depp = "john"
+ |depp: String
+ |
+ |scala> def a = depp
+ |warning: there was one deprecation warning; re-run with -deprecation for details
+ |a: String
+ |
+ |scala> :settings -deprecation
+ |
+ |scala> def b = depp
+ |<console>:11: warning: method depp is deprecated: Please don't do that.
+ | def b = depp
+ | ^
+ |b: String
+ |
+ |scala> :quit"""
}
diff --git a/test/files/run/t4671.check b/test/files/run/t4671.check
index 1640dac8e4..b267befee9 100644
--- a/test/files/run/t4671.check
+++ b/test/files/run/t4671.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> object o { val file = sys.props("partest.cwd") + "/t4671.scala" }
defined object o
diff --git a/test/files/run/t4710.check b/test/files/run/t4710.check
index 0dd49dfbd3..5f90c68ed1 100644
--- a/test/files/run/t4710.check
+++ b/test/files/run/t4710.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> def method : String = { implicit def f(s: Symbol) = "" ; 'symbol }
warning: there was one feature warning; re-run with -feature for details
diff --git a/test/files/run/t4950.check b/test/files/run/t4950.check
index 3f3a302b62..8994441163 100644
--- a/test/files/run/t4950.check
+++ b/test/files/run/t4950.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val 1 = 2
scala.MatchError: 2 (of class java.lang.Integer)
diff --git a/test/files/run/t5072.check b/test/files/run/t5072.check
index ab34e49869..586c0a6004 100644
--- a/test/files/run/t5072.check
+++ b/test/files/run/t5072.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class C
defined class C
diff --git a/test/files/run/t5256d.check b/test/files/run/t5256d.check
index c2b49989ab..3cdcb577b0 100644
--- a/test/files/run/t5256d.check
+++ b/test/files/run/t5256d.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
diff --git a/test/files/run/t5535.check b/test/files/run/t5535.check
index 84097ccea9..11d298c602 100644
--- a/test/files/run/t5535.check
+++ b/test/files/run/t5535.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> def h()(i: Int) = 1 + i
h: ()(i: Int)Int
diff --git a/test/files/run/t5537.check b/test/files/run/t5537.check
index 98265ccc92..bffa02f334 100644
--- a/test/files/run/t5537.check
+++ b/test/files/run/t5537.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> List[Predef.type]()
res0: List[scala.Predef.type] = List()
diff --git a/test/files/run/t5583.check b/test/files/run/t5583.check
index 32d285cbb3..72ad898e90 100644
--- a/test/files/run/t5583.check
+++ b/test/files/run/t5583.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> var s = 0
s: Int = 0
diff --git a/test/files/run/t5655.check b/test/files/run/t5655.check
index e8375c3e90..857a5ab556 100644
--- a/test/files/run/t5655.check
+++ b/test/files/run/t5655.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> object x { def x={} }
defined object x
diff --git a/test/files/run/t5789.check b/test/files/run/t5789.check
index 193abfaff0..d286922acc 100644
--- a/test/files/run/t5789.check
+++ b/test/files/run/t5789.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val n = 2
n: Int = 2
diff --git a/test/files/run/t6086-repl.check b/test/files/run/t6086-repl.check
index b904f118e8..f022e841cd 100644
--- a/test/files/run/t6086-repl.check
+++ b/test/files/run/t6086-repl.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> case class X(s: String)
defined class X
diff --git a/test/files/run/t6146b.check b/test/files/run/t6146b.check
index 6998873fb7..0e0c216cd7 100644
--- a/test/files/run/t6146b.check
+++ b/test/files/run/t6146b.check
@@ -2,8 +2,6 @@ t6146b.scala:15: warning: match may not be exhaustive.
It would fail on the following inputs: S2(), S3()
def foo(f: F[Int]) = f match { case X.S1 => }
^
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
diff --git a/test/files/run/t6187.check b/test/files/run/t6187.check
index 9a9e266ec6..28bc7e34b6 100644
--- a/test/files/run/t6187.check
+++ b/test/files/run/t6187.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context
import scala.language.experimental.macros
diff --git a/test/files/run/t6273.check b/test/files/run/t6273.check
index 3b682800df..6190ff254e 100644
--- a/test/files/run/t6273.check
+++ b/test/files/run/t6273.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val y = 55
y: Int = 55
diff --git a/test/files/run/t6320.check b/test/files/run/t6320.check
index af7c865690..08ef7fc211 100644
--- a/test/files/run/t6320.check
+++ b/test/files/run/t6320.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.language.dynamics
import scala.language.dynamics
diff --git a/test/files/run/t6329_repl.check b/test/files/run/t6329_repl.check
index ebb1aace7c..8909c47e79 100644
--- a/test/files/run/t6329_repl.check
+++ b/test/files/run/t6329_repl.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.classTag
import scala.reflect.classTag
diff --git a/test/files/run/t6329_repl_bug.check b/test/files/run/t6329_repl_bug.check
index 84297a629f..4b539f9e58 100644
--- a/test/files/run/t6329_repl_bug.check
+++ b/test/files/run/t6329_repl_bug.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
diff --git a/test/files/run/t6381.check b/test/files/run/t6381.check
index 49c6a784ad..c66eb4c376 100644
--- a/test/files/run/t6381.check
+++ b/test/files/run/t6381.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.language.experimental.macros
import scala.language.experimental.macros
diff --git a/test/files/run/t6434.check b/test/files/run/t6434.check
index 0a75ae2bd5..1f123ee9cd 100644
--- a/test/files/run/t6434.check
+++ b/test/files/run/t6434.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> def f(x: => Int): Int = x
f: (x: => Int)Int
diff --git a/test/files/run/t6439.check b/test/files/run/t6439.check
index c4b7591069..eee2da1b12 100644
--- a/test/files/run/t6439.check
+++ b/test/files/run/t6439.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class A
defined class A
diff --git a/test/files/run/t6502.scala b/test/files/run/t6502.scala
index d6b15a0189..f4fc39a03d 100644
--- a/test/files/run/t6502.scala
+++ b/test/files/run/t6502.scala
@@ -1,11 +1,14 @@
import scala.tools.nsc.Settings
-import scala.tools.nsc.interpreter.ILoop
+import scala.tools.nsc.interpreter.{ ILoop, replProps }
import scala.tools.nsc.settings.ClassPathRepresentationType
import scala.tools.partest._
object Test extends StoreReporterDirectTest {
def code = ???
+ lazy val headerLength = replProps.welcome.lines.size
+ lazy val promptLength = replProps.prompt.lines.size - 1 // extra newlines
+
def compileCode(code: String, jarFileName: String) = {
val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
compileString(newCompiler("-cp", classpath, "-d", s"${testOutput.path}/$jarFileName"))(code)
@@ -56,14 +59,21 @@ object Test extends StoreReporterDirectTest {
val jar = "test1.jar"
compileCode(app1, jar)
- val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar", "test.Test.test()")
+ val codeToRun = s"""
+ |:require ${testOutput.path}/$jar
+ |test.Test.test()
+ |""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
- val lines = output.split("\n")
- assert {
- lines(4).contains("Added") && lines(4).contains("test1.jar")
- }
+ var lines = output.lines.drop(headerLength)
+ lines = lines drop promptLength
+ val added = lines.next
+ assert (
+ added.contains("Added") && added.contains("test1.jar"),
+ s"[${added}] in [${output.lines.mkString("/")}]"
+ )
+ lines = lines drop promptLength
assert {
- lines(lines.length-3).contains("testing...")
+ lines.next.contains("testing...")
}
}
@@ -73,14 +83,21 @@ object Test extends StoreReporterDirectTest {
val jar2 = "test2.jar"
compileCode(app2, jar2)
- val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar1", s":require ${testOutput.path}/$jar2")
+ val codeToRun = s"""
+ |:require ${testOutput.path}/$jar1
+ |:require ${testOutput.path}/$jar2
+ |""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
- val lines = output.split("\n")
+ var lines = output.lines.drop(headerLength)
+ lines = lines drop promptLength
+ val added = lines.next
assert {
- lines(4).contains("Added") && lines(4).contains("test1.jar")
+ added.contains("Added") && added.contains("test1.jar")
}
+ lines = lines drop promptLength
+ val msg = lines.next
assert {
- lines(lines.length-3).contains("test2.jar") && lines(lines.length-3).contains("existing classpath entries conflict")
+ msg.contains("test2.jar") && msg.contains("existing classpath entries conflict")
}
}
@@ -90,28 +107,42 @@ object Test extends StoreReporterDirectTest {
val jar3 = "test3.jar"
compileCode(app3, jar3)
- val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar1", s":require ${testOutput.path}/$jar3", "test.Test3.test()")
+ val codeToRun = s"""
+ |:require ${testOutput.path}/$jar1
+ |:require ${testOutput.path}/$jar3
+ |test.Test3.test()
+ |""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
- val lines = output.split("\n")
+ var lines = output.lines.drop(headerLength)
+ lines = lines drop promptLength
+ val added = lines.next
assert {
- lines(4).contains("Added") && lines(4).contains("test1.jar")
+ added.contains("Added") && added.contains("test1.jar")
}
+ lines = lines drop (2 * promptLength + 1)
assert {
- lines(lines.length-3).contains("new object in existing package")
+ lines.next.contains("new object in existing package")
}
}
def test4(): Unit = {
// twice the same jar should be rejected
val jar1 = "test1.jar"
- val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar1", s":require ${testOutput.path}/$jar1")
+ val codeToRun = s"""
+ |:require ${testOutput.path}/$jar1
+ |:require ${testOutput.path}/$jar1
+ |""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
- val lines = output.split("\n")
+ var lines = output.lines.drop(headerLength)
+ lines = lines drop promptLength
+ val added = lines.next
assert {
- lines(4).contains("Added") && lines(4).contains("test1.jar")
+ added.contains("Added") && added.contains("test1.jar")
}
+ lines = lines drop promptLength
+ val msg = lines.next
assert {
- lines(lines.length-3).contains("test1.jar") && lines(lines.length-3).contains("existing classpath entries conflict")
+ msg.contains("test1.jar") && msg.contains("existing classpath entries conflict")
}
}
@@ -127,7 +158,10 @@ object Test extends StoreReporterDirectTest {
// classloader to parse .class files in order to read their names.
val jar = "test6.jar"
compileCode(app6, jar)
- val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar", "import test6._; new A; new Z")
+ val codeToRun = s"""
+ |:require ${testOutput.path}/$jar
+ |import test6._; new A; new Z
+ |""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
assert(output.contains("created test6.A"), output)
assert(output.contains("created test6.Z"), output)
@@ -141,6 +175,4 @@ object Test extends StoreReporterDirectTest {
test5()
test6()
}
-
- def toCodeInSeparateLines(lines: String*): String = lines mkString "\n"
}
diff --git a/test/files/run/t6507.check b/test/files/run/t6507.check
index 5da4aa3a24..75cf392304 100644
--- a/test/files/run/t6507.check
+++ b/test/files/run/t6507.check
@@ -1,8 +1,5 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :silent
-Switched off result printing.
scala> class A { override def toString() = { println("!"); "A" } }
@@ -15,7 +12,6 @@ scala> b = new A
scala> new A
scala> :silent
-Switched on result printing.
scala> res0
!
diff --git a/test/files/run/t6549.check b/test/files/run/t6549.check
index be3445927e..00203d5cc7 100644
--- a/test/files/run/t6549.check
+++ b/test/files/run/t6549.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> case class `X"`(var xxx: Any)
defined class X$u0022
diff --git a/test/files/run/t6937.check b/test/files/run/t6937.check
index 5c5d4485b6..b7b2f45385 100644
--- a/test/files/run/t6937.check
+++ b/test/files/run/t6937.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{universe=>ru}
diff --git a/test/files/run/t7185.check b/test/files/run/t7185.check
index e4f80a8ff9..6b7fbaf0b1 100644
--- a/test/files/run/t7185.check
+++ b/test/files/run/t7185.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> import scala.tools.reflect.ToolBox
import scala.tools.reflect.ToolBox
diff --git a/test/files/run/t7319.check b/test/files/run/t7319.check
index 885136b432..31923e7119 100644
--- a/test/files/run/t7319.check
+++ b/test/files/run/t7319.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> class M[A]
defined class M
diff --git a/test/files/run/t7482a.check b/test/files/run/t7482a.check
index a21ef7b68f..1120bb0271 100644
--- a/test/files/run/t7482a.check
+++ b/test/files/run/t7482a.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val v: java.util.ArrayList[String] = new java.util.ArrayList[String](5)
v: java.util.ArrayList[String] = []
diff --git a/test/files/run/t7634.check b/test/files/run/t7634.check
index 9c6b8b47dd..879aea67a2 100644
--- a/test/files/run/t7634.check
+++ b/test/files/run/t7634.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> .lines
diff --git a/test/files/run/t7747-repl.check b/test/files/run/t7747-repl.check
index 98e3d3b821..f19c39e7e1 100644
--- a/test/files/run/t7747-repl.check
+++ b/test/files/run/t7747-repl.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> var x = 10
x: Int = 10
diff --git a/test/files/run/t7801.check b/test/files/run/t7801.check
index e0b656b784..4ec89f0de6 100644
--- a/test/files/run/t7801.check
+++ b/test/files/run/t7801.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> val g: scala.reflect.internal.SymbolTable = null; import g.abort
g: scala.reflect.internal.SymbolTable = null
diff --git a/test/files/run/t7805-repl-i.check b/test/files/run/t7805-repl-i.check
index 7f66c06a11..24512c0067 100644
--- a/test/files/run/t7805-repl-i.check
+++ b/test/files/run/t7805-repl-i.check
@@ -2,8 +2,7 @@ Loading t7805-repl-i.script...
import util._
Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
+Type in expressions for evaluation. Or try :help.
scala> Console println Try(8)
Success(8)
diff --git a/test/files/run/t8843-repl-xlat.scala b/test/files/run/t8843-repl-xlat.scala
index 6426dbe7d4..215dd97061 100644
--- a/test/files/run/t8843-repl-xlat.scala
+++ b/test/files/run/t8843-repl-xlat.scala
@@ -4,9 +4,7 @@ import scala.tools.partest.SessionTest
// Handy hamburger helper for repl resources
object Test extends SessionTest {
def session =
-"""Type in expressions to have them evaluated.
-Type :help for more information.
-
+"""
scala> $intp.isettings.unwrapStrings = false
$intp.isettings.unwrapStrings: Boolean = false
diff --git a/test/files/run/t9170.scala b/test/files/run/t9170.scala
index 67a58d6803..d6cf516615 100644
--- a/test/files/run/t9170.scala
+++ b/test/files/run/t9170.scala
@@ -6,9 +6,7 @@ object Test extends SessionTest {
override def stripMargins = false
def session =
-"""Type in expressions to have them evaluated.
-Type :help for more information.
-
+"""
scala> object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
<console>:10: error: double definition:
def f[A](a: => A): Int at line 10 and
diff --git a/test/files/run/t9206.scala b/test/files/run/t9206.scala
index 2942d0f73e..872c980fe4 100644
--- a/test/files/run/t9206.scala
+++ b/test/files/run/t9206.scala
@@ -5,9 +5,7 @@ object Test extends SessionTest {
//override def prompt = "XXX> "
//Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40).
def session =
- s"""|Type in expressions to have them evaluated.
- |Type :help for more information.
- |
+ s"""|
|scala> val i: Int = "foo"
|<console>:10: error: type mismatch;
| found : String("foo")
diff --git a/test/files/run/tpeCache-tyconCache.check b/test/files/run/tpeCache-tyconCache.check
index ff604819e0..ac13d32f91 100644
--- a/test/files/run/tpeCache-tyconCache.check
+++ b/test/files/run/tpeCache-tyconCache.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
diff --git a/test/files/run/xMigration.check b/test/files/run/xMigration.check
index 304132a848..79ce544493 100644
--- a/test/files/run/xMigration.check
+++ b/test/files/run/xMigration.check
@@ -1,5 +1,3 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
scala> Map(1 -> "eis").values // no warn
res0: Iterable[String] = MapLike(eis)