[PowerAssert] Reproduce KT-66208

This commit is contained in:
Sergej Jaskiewicz
2024-02-29 16:02:16 +01:00
committed by Space Team
parent 540df2944b
commit 7d22825176
14 changed files with 334 additions and 4 deletions
@@ -1,3 +1,21 @@
fun box() = expectThrowableMessage {
assert("Hello, world!" !is String)
} + "\n\n" + expectThrowableMessage {
// Test that we don't just search for `!is` in the expression.
assert(" !is " !is String)
} + "\n\n" + expectThrowableMessage {
// Test multiline case
assert(
" !is "
!is
String
)
} + "\n\n" + expectThrowableMessage {
// Test that we don't assume whitespaces around the operator
assert("Hello, world!"/*!is*/!is/*!is*/String)
} + "\n\n" + expectThrowableMessage {
// Test nested `!is`
assert(("Hello, world!" !is String) !is Boolean)
}