From 801a26a54450fef16d1cd5c3937b03e035414133 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sun, 31 Jan 2016 18:23:27 +0300 Subject: [PATCH] Fix testData --- compiler/testData/checkLocalVariablesTable/itInLambda.kt | 2 ++ compiler/testData/cli/jvm/wrongAbiVersion.kt | 2 +- compiler/testData/cli/jvm/wrongAbiVersion.out | 6 ++---- .../codegen/bytecodeText/inlineFromOtherModule.kt | 4 +--- .../bytecodeText/statements/statementsComposition.kt | 1 + .../integration/smoke/scriptException/script.expected | 8 +++----- .../convertAssertToIf/inapplicableNoCondition.kt | 2 +- .../quickfix/autoImports/libraryPropertyRuntime.kt | 2 +- .../quickfix/autoImports/libraryPropertyRuntime.kt.after | 4 ++-- idea/testData/resolve/partialBodyResolve/IfReturn.dump | 2 +- 10 files changed, 15 insertions(+), 18 deletions(-) diff --git a/compiler/testData/checkLocalVariablesTable/itInLambda.kt b/compiler/testData/checkLocalVariablesTable/itInLambda.kt index 9adbd252cb8..359fccf3e96 100644 --- a/compiler/testData/checkLocalVariablesTable/itInLambda.kt +++ b/compiler/testData/checkLocalVariablesTable/itInLambda.kt @@ -2,6 +2,8 @@ public fun Iterable.myforEach(operation: (T) -> Unit) : Unit { for (element in this) operation(element) } +public fun println(v: Any?) {} + fun foo1() { (1..5).myforEach { println(it) diff --git a/compiler/testData/cli/jvm/wrongAbiVersion.kt b/compiler/testData/cli/jvm/wrongAbiVersion.kt index 13996d57bc2..a869ec2758c 100644 --- a/compiler/testData/cli/jvm/wrongAbiVersion.kt +++ b/compiler/testData/cli/jvm/wrongAbiVersion.kt @@ -3,5 +3,5 @@ import wrong.* fun foo(x: ClassWithWrongAbiVersion) { bar() - 1.printStackTrace(2, 3) + 1.replaceIndent(2, 3) } diff --git a/compiler/testData/cli/jvm/wrongAbiVersion.out b/compiler/testData/cli/jvm/wrongAbiVersion.out index 463d2ccb291..e30df808100 100644 --- a/compiler/testData/cli/jvm/wrongAbiVersion.out +++ b/compiler/testData/cli/jvm/wrongAbiVersion.out @@ -3,11 +3,9 @@ compiler/testData/cli/jvm/wrongAbiVersion.kt:4:5: error: unresolved reference: b bar() ^ compiler/testData/cli/jvm/wrongAbiVersion.kt:6:7: error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch: -public fun kotlin.Throwable.printStackTrace(): kotlin.Unit defined in kotlin -public fun kotlin.Throwable.printStackTrace(stream: java.io.PrintStream): kotlin.Unit defined in kotlin -public fun kotlin.Throwable.printStackTrace(writer: java.io.PrintWriter): kotlin.Unit defined in kotlin +public fun kotlin.String.replaceIndent(newIndent: kotlin.String = ...): kotlin.String defined in kotlin.text (note: this may be caused by the fact that some classes compiled with an incompatible version of Kotlin were found in the classpath. Such classes cannot be loaded properly by this version of Kotlin compiler. See below for more information) - 1.printStackTrace(2, 3) + 1.replaceIndent(2, 3) ^ compiler/testData/cli/jvm/wrongAbiVersionLib/bin/ClassWithWrongAbiVersion.class: error: class 'ClassWithWrongAbiVersion' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 0.30.0, expected version is $ABI_VERSION$ COMPILATION_ERROR \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/inlineFromOtherModule.kt b/compiler/testData/codegen/bytecodeText/inlineFromOtherModule.kt index da3f7e5b13d..13ce0d3d697 100644 --- a/compiler/testData/codegen/bytecodeText/inlineFromOtherModule.kt +++ b/compiler/testData/codegen/bytecodeText/inlineFromOtherModule.kt @@ -2,6 +2,4 @@ fun foo() { assert(1 == 1) { "Hahaha" } } -// 0 INVOKESTATIC kotlin\/KotlinPackage\.getASSERTIONS_ENABLED -// 1 INVOKESTATIC kotlin\/PreconditionsKt\.getASSERTIONS_ENABLED -// 0 INVOKESTATIC kotlin\/PreconditionsKt__.+\.getASSERTIONS_ENABLED +// 1 GETSTATIC kotlin\/_Assertions\.ENABLED diff --git a/compiler/testData/codegen/bytecodeText/statements/statementsComposition.kt b/compiler/testData/codegen/bytecodeText/statements/statementsComposition.kt index aedb610b584..fefd4b45fac 100644 --- a/compiler/testData/codegen/bytecodeText/statements/statementsComposition.kt +++ b/compiler/testData/codegen/bytecodeText/statements/statementsComposition.kt @@ -1,3 +1,4 @@ +fun print(v: Any?) {} fun foo() { val array = intArrayOf(1,2,3) diff --git a/compiler/testData/integration/smoke/scriptException/script.expected b/compiler/testData/integration/smoke/scriptException/script.expected index 6996b36d0ee..338c9e3ae51 100644 --- a/compiler/testData/integration/smoke/scriptException/script.expected +++ b/compiler/testData/integration/smoke/scriptException/script.expected @@ -1,10 +1,8 @@ ERR: java.lang.IllegalStateException: my error - at kotlin.PreconditionsKt__PreconditionsKt.error(Preconditions.kt:88) - at kotlin.PreconditionsKt.error(Unknown Source) - at Script.main(Unknown Source) - at Script.a(Unknown Source) - at Script.(Unknown Source) + at Script.main(script.kts:12) + at Script.a(script.kts:6) + at Script.(script.kts:9) Return code: 3 diff --git a/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt b/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt index c553a06e2ab..8c9f424f4d5 100644 --- a/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt +++ b/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: false // WITH_RUNTIME -// ERROR: None of the following functions can be called with the arguments supplied:
public fun assert(value: kotlin.Boolean): kotlin.Unit defined in kotlin
public inline fun assert(value: kotlin.Boolean, lazyMessage: () -> kotlin.Any): kotlin.Unit defined in kotlin +// ERROR: None of the following functions can be called with the arguments supplied:
@kotlin.internal.InlineOnly public inline fun assert(value: kotlin.Boolean): kotlin.Unit defined in kotlin
@kotlin.internal.InlineOnly public inline fun assert(value: kotlin.Boolean, lazyMessage: () -> kotlin.Any): kotlin.Unit defined in kotlin fun foo() { assert() diff --git a/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt b/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt index b0ef1512c70..6e6e0f36afa 100644 --- a/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt +++ b/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt @@ -3,5 +3,5 @@ package test fun foo() { - currentThread + asserter } diff --git a/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt.after b/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt.after index a9249582c7b..02c31c88ee6 100644 --- a/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt.after +++ b/idea/testData/quickfix/autoImports/libraryPropertyRuntime.kt.after @@ -2,8 +2,8 @@ package test -import kotlin.concurrent.currentThread +import kotlin.test.asserter fun foo() { - currentThread + asserter } diff --git a/idea/testData/resolve/partialBodyResolve/IfReturn.dump b/idea/testData/resolve/partialBodyResolve/IfReturn.dump index 5c512d0b75b..4bb22955d42 100644 --- a/idea/testData/resolve/partialBodyResolve/IfReturn.dump +++ b/idea/testData/resolve/partialBodyResolve/IfReturn.dump @@ -1,4 +1,4 @@ -Resolve target: fun kotlin.CharSequence.isNotEmpty(): kotlin.Boolean +Resolve target: inline fun kotlin.CharSequence.isNotEmpty(): kotlin.Boolean ---------------------------------------------- fun foo(p: String) { /* STATEMENT DELETED: if (x()) return */