[JVM_IR] Trim the expression test string for null assertions.
^KT-47166 Fixed.
This commit is contained in:
committed by
teamcityserver
parent
58adfd8488
commit
6b6ba77869
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user