aboutsummaryrefslogtreecommitdiff
path: root/test/test
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-05-12 14:26:16 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-05-12 14:26:16 +0200
commitdc36755731c92771647531427e390076e558567d (patch)
tree03e7cea4c0bf8a1487a8b03ccd0f98bb06254376 /test/test
parentfdf24243ffa07bdcef94032234d36170363bd8bb (diff)
downloaddotty-dc36755731c92771647531427e390076e558567d.tar.gz
dotty-dc36755731c92771647531427e390076e558567d.tar.bz2
dotty-dc36755731c92771647531427e390076e558567d.zip
Add CLI option to disable REPL syntax highlighting
Diffstat (limited to 'test/test')
-rw-r--r--test/test/TestREPL.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test/TestREPL.scala b/test/test/TestREPL.scala
index ab31af636..2beb9e40b 100644
--- a/test/test/TestREPL.scala
+++ b/test/test/TestREPL.scala
@@ -20,6 +20,9 @@ class TestREPL(script: String) extends REPL {
override lazy val config = new REPL.Config {
override val output = new NewLinePrintWriter(out)
+ override def context(ctx: Context) =
+ ctx.fresh.setSetting(ctx.settings.XreplNoColor, true)
+
override def input(in: Interpreter)(implicit ctx: Context) = new InteractiveReader {
val lines = script.lines
def readLine(prompt: String): String = {
@@ -38,8 +41,7 @@ class TestREPL(script: String) extends REPL {
out.close()
val printed = out.toString
val transcript = printed.drop(printed.indexOf(config.prompt))
- val transcriptNoColors = transcript.toString.replaceAll("\u001B\\[[;\\d]*m", "")
- if (transcriptNoColors != script) {
+ if (transcript.toString != script) {
println("input differs from transcript:")
println(transcript)
assert(false)