Skip to content

Commit afab82a

Browse files
committed
Support windows paths in FormatterTestFactory
1 parent ffd022a commit afab82a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core/src/test/java/org/jetbrains/ktfmt/FormatterTestFactory.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import kotlin.io.path.name
1212
import kotlin.io.path.nameWithoutExtension
1313
import kotlin.io.path.readText
1414
import kotlin.io.path.writeText
15-
import kotlin.io.resolve
1615
import org.junit.jupiter.api.Assertions.assertEquals
1716
import org.junit.jupiter.api.DynamicContainer
1817
import org.junit.jupiter.api.DynamicNode
1918
import org.junit.jupiter.api.DynamicTest
2019
import org.junit.jupiter.api.TestFactory
20+
import java.net.URI
2121

2222
/**
2323
* Base class for a group of file-based formatter cases.
@@ -62,7 +62,7 @@ abstract class FormatterTestFactory(
6262
// Without this, neither 'overwrite' nor navigation in IJ will work
6363
val root = run {
6464
val location = javaClass.protectionDomain?.codeSource?.location!!
65-
val root = location.toURI().path.substringBefore("build/classes/kotlin/test")
65+
val root = URI(location.toURI().path.substringBefore("build/classes/kotlin/test"))
6666
Path.of(root).resolve("src/test/resources/cases")
6767
}
6868
}

0 commit comments

Comments
 (0)