@@ -777,7 +777,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
777777
778778 def compare (file : File , expected : String ): Unit = {
779779 val actual = IO .read(file)
780- if (expected != actual) {
780+ if (removeWindowsLineEndings( expected) != removeWindowsLineEndings( actual) ) {
781781 reportMismatch(file, expected, actual)
782782 }
783783 }
@@ -789,8 +789,8 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
789789 })
790790
791791 private [sbtghactions] def diff (expected : String , actual : String ): String = {
792- val expectedLines = expected.split(" \n " , - 1 )
793- val actualLines = actual.split(" \n " , - 1 )
792+ val expectedLines = removeWindowsLineEndings( expected) .split(" \n " , - 1 )
793+ val actualLines = removeWindowsLineEndings( actual) .split(" \n " , - 1 )
794794 val (lines, _) = expectedLines.zipAll(actualLines, " " , " " ).foldLeft((Vector .empty[String ], false )) {
795795 case ((acc, foundDifference), (expectedLine, actualLine)) if expectedLine == actualLine =>
796796 (acc :+ actualLine, foundDifference)
@@ -816,4 +816,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
816816 }
817817 lines.mkString(" \n " )
818818 }
819+
820+ private [sbtghactions] def removeWindowsLineEndings (string : String ): String =
821+ string.replaceAll(" \\ r\\ n?" ," \n " )
819822}
0 commit comments