[JVM_IR] Trim the expression test string for null assertions.

^KT-47166 Fixed.
This commit is contained in:
Mads Ager
2021-06-11 14:54:20 +02:00
committed by teamcityserver
parent 58adfd8488
commit 6b6ba77869
6 changed files with 58 additions and 1 deletions
@@ -0,0 +1,31 @@
// TARGET_BACKEND: JVM
// FILE: test.kt
fun test(): String {
return A()
// Large comment that would cause the message for
// the non-null assertion to be very large if
// it is included verbatim in the message.
.foo()
}
fun box(): String {
try {
test()
} catch(e: Throwable) {
return if (e.message!!.length <= " must not be null".length + 50) {
"OK"
} else {
"FAIL1"
}
}
return "FAIL2"
}
// FILE: A.java
public class A {
public String foo() {
return null;
}
}