diff options
Diffstat (limited to 'src/partest')
-rw-r--r-- | src/partest/scala/tools/partest/ReplTest.scala | 19 |
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() +} |