From 427a1295c8583928b47b4a50cdbcc149fe15c45e Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Wed, 10 Mar 2021 20:27:49 +0300 Subject: [PATCH] Allow to create sub folders for expected data file that did not exist --- .../tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt | 1 + 1 file changed, 1 insertion(+) 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") }