diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-18 17:58:04 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-18 17:58:04 +0000 |
commit | d6eb989388f648eab0d55f25071f540c8df0d0da (patch) | |
tree | d294596017ca48387a33f5cbb0fc719230870578 /test | |
parent | ee365acb1752e7d789f32df3322a23526377f736 (diff) | |
download | scala-d6eb989388f648eab0d55f25071f540c8df0d0da.tar.gz scala-d6eb989388f648eab0d55f25071f540c8df0d0da.tar.bz2 scala-d6eb989388f648eab0d55f25071f540c8df0d0da.zip |
Fixing valueOfTerm in the repl.
Impressed at the amount of ticket traffic for an unadvertised internal
method. All the more reason to work toward that support repl API. Don't
worry, it'll come. Closes SI-4899, no review.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/imain.check | 1 | ||||
-rw-r--r-- | test/files/run/imain.scala | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/imain.check b/test/files/run/imain.check new file mode 100644 index 0000000000..76df308f3c --- /dev/null +++ b/test/files/run/imain.check @@ -0,0 +1 @@ +Some(246) diff --git a/test/files/run/imain.scala b/test/files/run/imain.scala new file mode 100644 index 0000000000..c164fb53ef --- /dev/null +++ b/test/files/run/imain.scala @@ -0,0 +1,17 @@ +object Test { + import scala.tools.nsc._ + import interpreter._ + import java.io.PrintWriter + + class NullOutputStream extends OutputStream { def write(b: Int) { } } + + def main(args: Array[String]) { + val settings = new Settings + settings.classpath.value = System.getProperty("java.class.path") + + val intp = new IMain(settings, new PrintWriter(new NullOutputStream)) + intp.interpret("def x0 = 123") + intp.interpret("val x1 = x0 * 2") + println(intp.valueOfTerm("x1")) + } +} |