@@ -18,14 +18,13 @@ import scala.reflect.internal.util.ScalaClassLoader
18
18
import scala .sys .process .{ Process , ProcessLogger }
19
19
import scala .tools .nsc .Properties .{ envOrNone , isWin , jdkHome , javaHome , propOrEmpty , setProp , versionMsg , javaVmName , javaVmVersion , javaVmInfo }
20
20
import scala .tools .nsc .{ Settings , CompilerCommand , Global }
21
- import scala .tools .nsc .io .{ AbstractFile }
22
21
import scala .tools .nsc .reporters .ConsoleReporter
23
22
import scala .tools .nsc .util .{ Exceptional , stackTraceString }
24
23
import scala .util .{ Try , Success , Failure }
25
24
import ClassPath .{ join , split }
26
25
import TestState .{ Pass , Fail , Crash , Uninitialized , Updated }
27
26
28
- import FileManager .{compareFiles , compareContents , joinPaths }
27
+ import FileManager .{ compareFiles , compareContents , joinPaths , withTempFile }
29
28
30
29
class TestTranscript {
31
30
import NestUI .color ._
@@ -375,13 +374,13 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
375
374
genUpdated()
376
375
case Some (false ) =>
377
376
// Get a word-highlighted diff from git if we can find it
378
- val bestDiff = if (updating.isEmpty) " " else {
379
- if (checkFile.canRead)
380
- gitDiff(logFile, checkFile) getOrElse {
381
- s " diff $logFile $checkFile\n $diff"
377
+ val bestDiff =
378
+ if (updating.isEmpty) " "
379
+ else if (checkFile.canRead)
380
+ withTempFile(outFile, fileBase, filteredCheck) { f =>
381
+ gitDiff(logFile, f) getOrElse f " diff $logFile $checkFile%n $diff"
382
382
}
383
383
else diff
384
- }
385
384
_transcript append bestDiff
386
385
genFail(" output differs" )
387
386
// TestState.fail("output differs", "output differs",
@@ -606,7 +605,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
606
605
val prompt = " \n nsc> "
607
606
val (swr, wr) = newTestWriters()
608
607
609
- NestUI .verbose(this + " running test " + fileBase)
608
+ NestUI .verbose(s " $this running test $ fileBase" )
610
609
val dir = parentFile
611
610
val resFile = new File (dir, fileBase + " .res" )
612
611
0 commit comments