From a182c907bc998edc65006b356a84de6cbe30cb11 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 25 Aug 2023 16:09:33 +0200 Subject: [PATCH] Fix scripting testdata for changed diagnostics in K2 --- .../script/examples/jvm/resolve/maven/test/resolveTest.kt | 4 ++-- .../kotlin/script/examples/jvm/simple/test/simpleTest.kt | 4 ++-- .../test/org/jetbrains/kotlin/mainKts/test/mainKtsTest.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/examples/scripting/jvm-maven-deps/host/test/org/jetbrains/kotlin/script/examples/jvm/resolve/maven/test/resolveTest.kt b/libraries/examples/scripting/jvm-maven-deps/host/test/org/jetbrains/kotlin/script/examples/jvm/resolve/maven/test/resolveTest.kt index d98b4172ae6..dd0d1e67858 100644 --- a/libraries/examples/scripting/jvm-maven-deps/host/test/org/jetbrains/kotlin/script/examples/jvm/resolve/maven/test/resolveTest.kt +++ b/libraries/examples/scripting/jvm-maven-deps/host/test/org/jetbrains/kotlin/script/examples/jvm/resolve/maven/test/resolveTest.kt @@ -28,10 +28,10 @@ class ResolveTest { val res = evalFile(File("testData/hello-unresolved-junit.scriptwithdeps.kts")) Assert.assertTrue( - "test failed - expecting a failure with the message \"Unresolved reference: junit\" but received " + + "test failed - expecting a failure with the message \"Unresolved reference 'junit'\" but received " + (if (res is ResultWithDiagnostics.Failure) "failure" else "success") + ":\n ${res.reports.joinToString("\n ") { it.message + if (it.exception == null) "" else ": ${it.exception}" }}", - res is ResultWithDiagnostics.Failure && res.reports.any { it.message.contains("Unresolved reference: junit") }) + res is ResultWithDiagnostics.Failure && res.reports.any { it.message.contains("Unresolved reference 'junit'.") }) } @Test diff --git a/libraries/examples/scripting/jvm-simple-script/host/test/org/jetbrains/kotlin/script/examples/jvm/simple/test/simpleTest.kt b/libraries/examples/scripting/jvm-simple-script/host/test/org/jetbrains/kotlin/script/examples/jvm/simple/test/simpleTest.kt index b5f9ae0e42d..d532bd5acc3 100644 --- a/libraries/examples/scripting/jvm-simple-script/host/test/org/jetbrains/kotlin/script/examples/jvm/simple/test/simpleTest.kt +++ b/libraries/examples/scripting/jvm-simple-script/host/test/org/jetbrains/kotlin/script/examples/jvm/simple/test/simpleTest.kt @@ -28,9 +28,9 @@ class SimpleTest { val res = evalFile(File("testData/error.simplescript.kts")) Assert.assertTrue( - "test failed - expecting a failure with the message \"Unresolved reference: abracadabra\" but received " + + "test failed - expecting a failure with the message \"Unresolved reference 'abracadabra'.\" but received " + (if (res is ResultWithDiagnostics.Failure) "failure" else "success") + ":\n ${res.reports.joinToString("\n ") { it.message + if (it.exception == null) "" else ": ${it.exception}" }}", - res is ResultWithDiagnostics.Failure && res.reports.any { it.message.contains("Unresolved reference: abracadabra") }) + res is ResultWithDiagnostics.Failure && res.reports.any { it.message.contains("Unresolved reference 'abracadabra'.") }) } } \ No newline at end of file diff --git a/libraries/tools/kotlin-main-kts-test/test/org/jetbrains/kotlin/mainKts/test/mainKtsTest.kt b/libraries/tools/kotlin-main-kts-test/test/org/jetbrains/kotlin/mainKts/test/mainKtsTest.kt index 481b3f83fd2..943fe927229 100644 --- a/libraries/tools/kotlin-main-kts-test/test/org/jetbrains/kotlin/mainKts/test/mainKtsTest.kt +++ b/libraries/tools/kotlin-main-kts-test/test/org/jetbrains/kotlin/mainKts/test/mainKtsTest.kt @@ -110,7 +110,7 @@ class MainKtsTest { @Test fun testUnresolvedJunit() { val res = evalFile(File("$TEST_DATA_ROOT/hello-unresolved-junit.main.kts")) - assertFailed("Unresolved reference: junit", res) + assertFailed("Unresolved reference 'junit'.", res) } @Test