diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-09 17:46:04 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-09 17:46:04 -0800 |
commit | 71c596a2af1ce06d9e9e951916e4a3863375fbe0 (patch) | |
tree | 8be3567d3746386240f6f2a8eaffe3a0fdcbb118 /test | |
parent | 6724890e36c5c3c6a6b79f1b5322b9c2932de9e1 (diff) | |
parent | 9dfac45e808017982e04fb20567c70b76dee3ede (diff) | |
download | scala-71c596a2af1ce06d9e9e951916e4a3863375fbe0.tar.gz scala-71c596a2af1ce06d9e9e951916e4a3863375fbe0.tar.bz2 scala-71c596a2af1ce06d9e9e951916e4a3863375fbe0.zip |
Merge pull request #3433 from rjolly/si-7933
SI-7933 REPL javax.script eval is cached result
Diffstat (limited to 'test')
-rw-r--r-- | test/disabled/run/t7843-jsr223-service.scala | 18 | ||||
-rw-r--r-- | test/files/run/t7843-jsr223-service.check (renamed from test/disabled/run/t7843-jsr223-service.check) | 0 | ||||
-rw-r--r-- | test/files/run/t7843-jsr223-service.scala | 8 | ||||
-rw-r--r-- | test/files/run/t7933.check | 2 | ||||
-rw-r--r-- | test/files/run/t7933.scala | 11 |
5 files changed, 21 insertions, 18 deletions
diff --git a/test/disabled/run/t7843-jsr223-service.scala b/test/disabled/run/t7843-jsr223-service.scala deleted file mode 100644 index e2ea850698..0000000000 --- a/test/disabled/run/t7843-jsr223-service.scala +++ /dev/null @@ -1,18 +0,0 @@ -/*DISABLED: - For Paul, it steals focus when it runs. - - For me, it fails with some platform specific extra output: - - -ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider apple.applescript.AppleScriptEngin - n: Object = 10 - 12345678910 -*/ -import javax.script._ -import scala.tools.nsc.interpreter.IMain - -object Test extends App { - val engine = new ScriptEngineManager getEngineByName "scala" - engine.asInstanceOf[IMain].settings.usejavacp.value = true - engine put ("n", 10) - engine eval "1 to n.asInstanceOf[Int] foreach print" -} diff --git a/test/disabled/run/t7843-jsr223-service.check b/test/files/run/t7843-jsr223-service.check index a668df3567..a668df3567 100644 --- a/test/disabled/run/t7843-jsr223-service.check +++ b/test/files/run/t7843-jsr223-service.check diff --git a/test/files/run/t7843-jsr223-service.scala b/test/files/run/t7843-jsr223-service.scala new file mode 100644 index 0000000000..31112212ea --- /dev/null +++ b/test/files/run/t7843-jsr223-service.scala @@ -0,0 +1,8 @@ +import scala.tools.nsc.interpreter.IMain + +object Test extends App { + val engine = new IMain.Factory getScriptEngine() + engine.asInstanceOf[IMain].settings.usejavacp.value = true + engine put ("n", 10) + engine eval "1 to n.asInstanceOf[Int] foreach print" +} diff --git a/test/files/run/t7933.check b/test/files/run/t7933.check new file mode 100644 index 0000000000..317e9677c3 --- /dev/null +++ b/test/files/run/t7933.check @@ -0,0 +1,2 @@ +hello +hello diff --git a/test/files/run/t7933.scala b/test/files/run/t7933.scala new file mode 100644 index 0000000000..b06dffcd80 --- /dev/null +++ b/test/files/run/t7933.scala @@ -0,0 +1,11 @@ +import scala.tools.nsc.interpreter.IMain + +object Test extends App { + val engine = new IMain.Factory getScriptEngine() + engine.asInstanceOf[IMain].settings.usejavacp.value = true + val res2 = engine.asInstanceOf[javax.script.Compilable] + res2 compile "8" eval() + val res5 = res2 compile """println("hello") ; 8""" + res5 eval() + res5 eval() +} |