From 24f00f8fdabbede8a8aad87c1af401ae63a1a0a9 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Fri, 12 Nov 2021 17:47:39 +0300 Subject: [PATCH] [Native][tests] Warn when committed TestFile is committed again --- .../org/jetbrains/kotlin/konan/blackboxtest/TestCase.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/TestCase.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/TestCase.kt index 60dd9c7ef95..9f73073eb2c 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/TestCase.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/TestCase.kt @@ -46,13 +46,13 @@ internal class TestFile private constructor( // An optimization to release the memory occupied by numerous file texts. fun commit() { - state = when (val state = state) { + when (val state = state) { is State.Uncommitted -> { location.parentFile.mkdirs() location.writeText(state.text) - State.Committed + this.state = State.Committed } - is State.Committed -> state + is State.Committed -> System.err.println("$this has been committed again. Need to check why this had happened.") } }