Skip to content

Commit

Permalink
Try to fix test Windows OS
Browse files Browse the repository at this point in the history
Closes #2658
  • Loading branch information
paul-dingemans committed May 28, 2024
1 parent 78cb2d8 commit 036fcbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ internal class CodeFormatter(
eolEditorConfigProperty == PropertyType.EndOfLineValue.crlf ||
eolEditorConfigProperty != PropertyType.EndOfLineValue.lf &&
doesNotContain('\r') ->
"\r\n"
"\r\n".also { LOGGER.debug { "line separator: ${eolEditorConfigProperty.name} --> CRLF" } }

else -> "\n"
else -> "\n".also { LOGGER.debug { "line separator: ${eolEditorConfigProperty.name} --> LF" } }
}

private fun Code.doesNotContain(char: Char) = content.lastIndexOf(char) != -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ class KtLintTest {
),
).format(Code.fromSnippet(code)) { _ -> AutocorrectDecision.ALLOW_AUTOCORRECT }

assertThat(actual.toByteArray()).isEqualTo(code.toByteArray())
assertThat(actual).isEqualTo(code)
}

Expand Down

0 comments on commit 036fcbb

Please sign in to comment.