summaryrefslogtreecommitdiff
path: root/test/files/run/repl-inline.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/repl-inline.scala')
-rw-r--r--test/files/run/repl-inline.scala18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/files/run/repl-inline.scala b/test/files/run/repl-inline.scala
index 5a5f205ad8..260ed28a4f 100644
--- a/test/files/run/repl-inline.scala
+++ b/test/files/run/repl-inline.scala
@@ -1,7 +1,8 @@
import scala.tools.nsc._
object Test {
- val testCode = """
+ val testCode =
+ """
def callerOfCaller = Thread.currentThread.getStackTrace.drop(2).head.getMethodName
def g = callerOfCaller
def h = g
@@ -12,10 +13,15 @@ assert(h == "h", h)
"""
def main(args: Array[String]) {
- val settings = new Settings()
- settings.processArgumentString("-opt:l:classpath")
- settings.usejavacp.value = true
- val repl = new interpreter.IMain(settings)
- testCode.linesIterator.foreach(repl.interpret(_))
+ def test(f: Settings => Unit): Unit = {
+ val settings = new Settings()
+ settings.processArgumentString("-opt:l:classpath")
+ f(settings)
+ settings.usejavacp.value = true
+ val repl = new interpreter.IMain(settings)
+ testCode.linesIterator.foreach(repl.interpret(_))
+ }
+ test(_ => ())
+ test(_.Yreplclassbased.value = true)
}
}