summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-09-14 22:11:46 -0700
committerSom Snytt <som.snytt@gmail.com>2013-09-14 22:11:46 -0700
commitb4671f0103faf079b2c197c8875b484318bc6062 (patch)
tree470ab0bd109ed1a22e0c58e464c0cf58507438e4 /test
parent12bca51027e753763748f8456317fa03aaad6162 (diff)
downloadscala-b4671f0103faf079b2c197c8875b484318bc6062.tar.gz
scala-b4671f0103faf079b2c197c8875b484318bc6062.tar.bz2
scala-b4671f0103faf079b2c197c8875b484318bc6062.zip
SI-7843 Restore JSR 223 service entry
The 2.10 fix to remove the ScriptEngine service entry was inadvertently forwarded to 2.11. This commit reverts and adds a test. This situation was entirely foreseen by retronym, proving beyond doubt that he is in fact a time traveler, as hinted by his name. He brings bugs forward into the future and returns into the past with fixes and other alien technology like scalaz.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t7843-jsr223-service.check2
-rw-r--r--test/files/run/t7843-jsr223-service.scala10
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t7843-jsr223-service.check b/test/files/run/t7843-jsr223-service.check
new file mode 100644
index 0000000000..a668df3567
--- /dev/null
+++ b/test/files/run/t7843-jsr223-service.check
@@ -0,0 +1,2 @@
+n: Object = 10
+12345678910
diff --git a/test/files/run/t7843-jsr223-service.scala b/test/files/run/t7843-jsr223-service.scala
new file mode 100644
index 0000000000..0e3a9e572c
--- /dev/null
+++ b/test/files/run/t7843-jsr223-service.scala
@@ -0,0 +1,10 @@
+
+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"
+}