[PowerAssert] Correctly align infix calls for built-in operators

Instead of searching for the operator in the string representation of
the whole expression, consider the operator's start to be the
first non-whitespace non-dot character _after_ the LHS of the infix
expression.

This fixes cases like this:
```
assert("Name in " in listOf("Hello", "World"))
             |       |
             |       [Hello, World]
             false
```

^KT-66208 Fixed
This commit is contained in:
Sergej Jaskiewicz
2024-02-29 17:49:42 +01:00
committed by Space Team
parent 7d22825176
commit 54c58671fb
8 changed files with 125 additions and 94 deletions
@@ -5,8 +5,8 @@ assert(null is String)
Assertion failed
assert(!(" is " is String))
| |
| true
| |
| true
false
Assertion failed
@@ -14,22 +14,22 @@ assert(!(
|
false
" is "
|
true
is
|
true
String
))
Assertion failed
assert(null/*is*/is/*is*/String)
|
false
|
false
Assertion failed
assert(!((null is String) is Boolean))
| |
| true
| | |
| | true
| false
false
@@ -5,27 +5,27 @@ assert("Hello, world!" !is String)
Assertion failed
assert(" !is " !is String)
|
false
|
false
Assertion failed
assert(
" !is "
|
false
!is
|
false
String
)
Assertion failed
assert("Hello, world!"/*!is*/!is/*!is*/String)
|
false
|
false
Assertion failed
assert(("Hello, world!" !is String) !is Boolean)
|
false
| |
| false
false