Skip to content

Commit

Permalink
FormatTests: improve asserting idempotency failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Dec 24, 2023
1 parent ee7b8a9 commit ea69542
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scalafmt-tests/src/test/scala/org/scalafmt/FormatTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,14 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions {
case Formatted.Success(code) => code
}
debug2.printTest()
assertEquals(formattedAgain, obtained, "Idempotency violated")
if (!onlyManual) {
assertEquals(obtained, t.expected)
if (onlyManual)
assertEquals(formattedAgain, obtained, "Idempotency violated")
else {
assertEquals(
if (formattedAgain == obtained) formattedAgain
else "Idempotency violated\n" + formattedAgain,
t.expected
)
}
}

Expand Down

0 comments on commit ea69542

Please sign in to comment.