File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/dotty/tools/dotc/util Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ object DiffUtil {
61
61
(fnd, exp, totalChange.toDouble / (expected.length + found.length))
62
62
}
63
63
64
- def mkColoredLineDiff (expected : String , actual : String ): String = {
64
+ def mkColoredLineDiff (expected : String , actual : String , expectedSize : Int ): String = {
65
65
lazy val diff = {
66
66
val tokens = splitTokens(expected, Nil ).toArray
67
67
val lastTokens = splitTokens(actual, Nil ).toArray
@@ -90,9 +90,9 @@ object DiffUtil {
90
90
DELETION_COLOR + str + ANSI_DEFAULT
91
91
}.mkString
92
92
93
- val pad = " " * ( 60 - expected.length).max( 0 )
93
+ val pad = " " * 0 .max(expectedSize - expected.length)
94
94
95
- expectedDiff + pad + " | " + actualDiff
95
+ expectedDiff + pad + " | " + actualDiff
96
96
}
97
97
98
98
def mkColoredCodeDiff (code : String , lastCode : String , printDiffDel : Boolean ): String = {
Original file line number Diff line number Diff line change @@ -511,8 +511,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
511
511
512
512
if (outputLines.length != checkLines.length || ! linesMatch) {
513
513
// Print diff to files and summary:
514
+ val expectedSize = DiffUtil .EOF .length max outputLines.map(_.length).max
514
515
val diff = (outputLines :+ DiffUtil .EOF ).zip(checkLines :+ DiffUtil .EOF ).map { case (act, exp) =>
515
- DiffUtil .mkColoredLineDiff(exp, act)
516
+ DiffUtil .mkColoredLineDiff(exp, act, expectedSize )
516
517
}.mkString(" \n " )
517
518
518
519
val msg =
You can’t perform that action at this time.
0 commit comments