diff --git a/scalafmt-tests/src/test/scala/org/scalafmt/FormatTests.scala b/scalafmt-tests/src/test/scala/org/scalafmt/FormatTests.scala index bcde94dcbf..25c5da04e6 100644 --- a/scalafmt-tests/src/test/scala/org/scalafmt/FormatTests.scala +++ b/scalafmt-tests/src/test/scala/org/scalafmt/FormatTests.scala @@ -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 + ) } }