From 686e5e7f2bab908b600d7a882efcb2ac8b607dc9 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Mon, 11 Oct 2021 15:54:39 +0300 Subject: [PATCH] [TEST] Fix test data. Due to JS IR runner doesn't override stdout test fails. Remove using stdout from test. --- .../codegen/box/contracts/fieldReadInConstructor.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/testData/codegen/box/contracts/fieldReadInConstructor.kt b/compiler/testData/codegen/box/contracts/fieldReadInConstructor.kt index 54b0ba7ba2f..ffe9ccfdc03 100644 --- a/compiler/testData/codegen/box/contracts/fieldReadInConstructor.kt +++ b/compiler/testData/codegen/box/contracts/fieldReadInConstructor.kt @@ -1,16 +1,19 @@ // !OPT_IN: kotlin.contracts.ExperimentalContracts // IGNORE_BACKEND: NATIVE // WITH_RUNTIME -// IGNORE_BACKEND: JS_IR import kotlin.contracts.* +var x = "" + +fun baz(s: String) { x += s } + class A { val value = "Some value" init { foo { - println(value) + baz(value) } } } @@ -23,6 +26,7 @@ fun foo(block: () -> Unit) { } fun box(): String { - A() + val a = A() + if (x != a.value) return "FAIL: $x" return "OK" } \ No newline at end of file