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 036fcbb commit f9f7847
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.pinterest.ktlint.rule.engine.core.api.editorconfig.END_OF_LINE_PROPER
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EditorConfig
import com.pinterest.ktlint.rule.engine.core.api.ifAutocorrectAllowed
import com.pinterest.ktlint.rule.engine.core.api.isRoot
import io.github.oshai.kotlinlogging.KotlinLogging
import org.assertj.core.api.Assertions.assertThat
import org.ec4j.core.model.PropertyType
import org.jetbrains.kotlin.com.intellij.lang.ASTNode
Expand All @@ -36,6 +37,8 @@ import org.jetbrains.kotlin.com.intellij.psi.tree.IElementType
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test

private val LOGGER = KotlinLogging.logger {}.initKtLintKLogger()

class KtLintTest {
/**
* API Consumers directly use the ktlint-rule-engine module. Tests in this module should guarantee that the API is kept stable.
Expand Down Expand Up @@ -292,7 +295,20 @@ class KtLintTest {

@Test
fun testFormatUnicodeBom() {
val code = getResourceAsText("spec/format-unicode-bom.kt.spec")
val originalCode =
getResourceAsText("spec/format-unicode-bom.kt.spec")
val code =
originalCode
.replace("\r\n", "\n")
.replace("\r", "\n")
if (code != originalCode) {
LOGGER.debug {
"""
Original code: ${originalCode.toByteArray()}
Changed code : ${code.toByteArray()}
""".trimIndent()
}
}

val actual =
KtLintRuleEngine(
Expand Down

0 comments on commit f9f7847

Please sign in to comment.