Fix scripting testdata for changed diagnostics in K2

This commit is contained in:
Ilya Chernikov
2023-08-25 16:09:33 +02:00
committed by Space Team
parent 8a10070772
commit a182c907bc
3 changed files with 5 additions and 5 deletions
@@ -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
@@ -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'.") })
}
}
@@ -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