summaryrefslogtreecommitdiff
path: root/src/partest/scala/tools/partest/ReplTest.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-28 21:23:59 +0000
committerPaul Phillips <paulp@improving.org>2011-02-28 21:23:59 +0000
commitfdaa0a7a0178eab124d65f96e872c07c4400c94a (patch)
tree2d2e8c1214e7fb253954ac1e73e616d06d9de7e6 /src/partest/scala/tools/partest/ReplTest.scala
parent34719ee9cb51650550cfcf849178cf5da5a93dd5 (diff)
downloadscala-fdaa0a7a0178eab124d65f96e872c07c4400c94a.tar.gz
scala-fdaa0a7a0178eab124d65f96e872c07c4400c94a.tar.bz2
scala-fdaa0a7a0178eab124d65f96e872c07c4400c94a.zip
Break 9 tests, fix 9 tests, realize you broke t...
Break 9 tests, fix 9 tests, realize you broke the test you checked in between +9 and -9. Fix that and generalize the repl tests a little. I think we're all the way there. No review.
Diffstat (limited to 'src/partest/scala/tools/partest/ReplTest.scala')
-rw-r--r--src/partest/scala/tools/partest/ReplTest.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/partest/scala/tools/partest/ReplTest.scala b/src/partest/scala/tools/partest/ReplTest.scala
new file mode 100644
index 0000000000..232d605bb0
--- /dev/null
+++ b/src/partest/scala/tools/partest/ReplTest.scala
@@ -0,0 +1,19 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2011 LAMP/EPFL
+ * @author Paul Phillips
+ */
+
+package scala.tools.partest
+
+import scala.tools.nsc.interpreter.ILoop
+
+/** A trait for testing repl code. It drops the first line
+ * of output because the real repl prints a version number.
+ */
+abstract class ReplTest extends App {
+ def code: String
+ def eval() = (ILoop run code).lines drop 1
+ def show() = eval() foreach println
+
+ show()
+}