[IR][tests] Make ABI compatibility tests less verbose, part 2
This commit is contained in:
+4
-18
@@ -1,19 +1,5 @@
|
||||
fun box(): String {
|
||||
return try {
|
||||
bar()
|
||||
} catch(e: Throwable) {
|
||||
e.checkLinkageError("function foo can not be called")
|
||||
}
|
||||
}
|
||||
|
||||
private fun Throwable.checkLinkageError(prefix: String): String {
|
||||
if (this::class.simpleName != "IrLinkageError") return "Unexpected throwable: ${this::class}"
|
||||
|
||||
val expectedMessagePrefix = "$prefix because it uses unlinked symbols"
|
||||
val actualMessage = message.orEmpty()
|
||||
|
||||
return if (actualMessage.startsWith(expectedMessagePrefix))
|
||||
"OK"
|
||||
else
|
||||
"EXPECTED: $expectedMessagePrefix, ACTUAL: $actualMessage"
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
expectFailure(prefixed("function foo can not be called")) { bar() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user