diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt index 2b9b75dc273..502f7ce638a 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt @@ -19,6 +19,7 @@ object JUnit5Assertions : AssertionsService() { try { val actualText = actual.trim { it <= ' ' }.convertLineSeparators().trimTrailingWhitespacesAndAddNewlineAtEOF() if (!expectedFile.exists()) { + expectedFile.parentFile.mkdirs() expectedFile.writeText(actualText) org.junit.jupiter.api.fail("Expected data file did not exist. Generating: $expectedFile") }