Skip to content

Commit 34976e7

Browse files
committed
Add docs to TestREPL
1 parent 19aa1bd commit 34976e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test/TestREPL.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ import dotty.tools.dotc.core.Contexts.Context
55
import collection.mutable
66
import java.io.StringWriter
77

8+
/** A subclass of REPL used for testing.
9+
* It takes a transcript of a REPL session in `script`. The transcript
10+
* starts with the first input prompt `scala> ` and ends with `scala> :quit` and a newline.
11+
* Invoking `process()` on the `TestREPL` runs all input lines and
12+
* collects then interleaved with REPL output in a string writer `out`.
13+
* Invoking `check()` checks that the collected output matches the original
14+
* `script`.
15+
*/
816
class TestREPL(script: String) extends REPL {
917

1018
private val out = new StringWriter()

0 commit comments

Comments
 (0)