aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test/TestREPL.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test/TestREPL.scala b/test/test/TestREPL.scala
index 30dad2b64..d01038c43 100644
--- a/test/test/TestREPL.scala
+++ b/test/test/TestREPL.scala
@@ -5,6 +5,14 @@ import dotty.tools.dotc.core.Contexts.Context
import collection.mutable
import java.io.StringWriter
+/** A subclass of REPL used for testing.
+ * It takes a transcript of a REPL session in `script`. The transcript
+ * starts with the first input prompt `scala> ` and ends with `scala> :quit` and a newline.
+ * Invoking `process()` on the `TestREPL` runs all input lines and
+ * collects then interleaved with REPL output in a string writer `out`.
+ * Invoking `check()` checks that the collected output matches the original
+ * `script`.
+ */
class TestREPL(script: String) extends REPL {
private val out = new StringWriter()