Skip to content

Commit

Permalink
Show git diff command on checkfile failure (#19308)
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha authored Dec 20, 2023
2 parents 3e2a9a5 + b5479c5 commit 8b2d1dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler/test/dotty/tools/vulpix/FileDiff.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import java.nio.charset.StandardCharsets


object FileDiff {
def diffCommand(expectFile: String, actualFile: String): String =
s"git diff --no-index -- $expectFile $actualFile"

def diffMessage(expectFile: String, actualFile: String): String =
s"""Test output dumped in: $actualFile
| See diff of the checkfile (`brew install icdiff` for colored diff)
| > diff $expectFile $actualFile
| See diff of the checkfile (`--color=always` for colored diff)
| > ${FileDiff.diffCommand(expectFile, actualFile)}
| Replace checkfile with current output
| > mv $actualFile $expectFile
""".stripMargin
Expand Down

0 comments on commit 8b2d1dd

Please sign in to comment.