diff options
author | Martin Odersky <odersky@gmail.com> | 2016-03-18 11:33:14 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-03-18 12:25:48 +0100 |
commit | a7a0543d4e98319e70acc44510071ce2576077b8 (patch) | |
tree | dfa4a839164b7e128d5fe6a1bad244153d7b4f3b /test/test/TestREPL.scala | |
parent | d8a7a59ef96127ca64f27e0cc2529d775b1fa9c9 (diff) | |
download | dotty-a7a0543d4e98319e70acc44510071ce2576077b8.tar.gz dotty-a7a0543d4e98319e70acc44510071ce2576077b8.tar.bz2 dotty-a7a0543d4e98319e70acc44510071ce2576077b8.zip |
Add docs to TestREPL
Diffstat (limited to 'test/test/TestREPL.scala')
-rw-r--r-- | test/test/TestREPL.scala | 8 |
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() |