diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-04-13 17:02:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 17:02:55 +0200 |
commit | 889ed89312cbe70040df92e84432853d38906308 (patch) | |
tree | a7f0aefe7af524cba9c3863f312afdac2d51d375 /compiler/test/dotty/tools/vulpix | |
parent | 0fe56ea73e6775a315f54772dc6bfb40815c7c98 (diff) | |
parent | 28cbce5a6f00f600225c9b3787b564c39484beba (diff) | |
download | dotty-889ed89312cbe70040df92e84432853d38906308.tar.gz dotty-889ed89312cbe70040df92e84432853d38906308.tar.bz2 dotty-889ed89312cbe70040df92e84432853d38906308.zip |
Merge pull request #2259 from dotty-staging/fix-#2245
Fix #2245: strip colors from strings before writing to file
Diffstat (limited to 'compiler/test/dotty/tools/vulpix')
-rw-r--r-- | compiler/test/dotty/tools/vulpix/SummaryReport.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/test/dotty/tools/vulpix/SummaryReport.scala b/compiler/test/dotty/tools/vulpix/SummaryReport.scala index 678d88809..dae83c13d 100644 --- a/compiler/test/dotty/tools/vulpix/SummaryReport.scala +++ b/compiler/test/dotty/tools/vulpix/SummaryReport.scala @@ -131,11 +131,14 @@ final class SummaryReport extends SummaryReporting { if (cleanUps.nonEmpty) cleanUps.foreach(_.apply()) } + private def removeColors(msg: String): String = + msg.replaceAll("\u001b\\[.*?m", "") + def echoToLog(msg: String): Unit = - TestReporter.logPrintln(msg) + TestReporter.logPrintln(removeColors(msg)) def echoToLog(it: Iterator[String]): Unit = { - it.foreach(TestReporter.logPrint) + it.foreach(msg => TestReporter.logPrint(removeColors(msg))) TestReporter.logFlush() } } |