[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:
committed by
Space Team
parent
7d22825176
commit
54c58671fb
+11
-11
@@ -6,17 +6,17 @@ assert("Hello" !in listOf("Hello", "World"))
|
||||
|
||||
Assertion failed
|
||||
assert(" !in " !in listOf(" !in "))
|
||||
| |
|
||||
| [ !in ]
|
||||
false
|
||||
| |
|
||||
| [ !in ]
|
||||
false
|
||||
|
||||
Assertion failed
|
||||
assert(
|
||||
" !in "
|
||||
|
|
||||
false
|
||||
|
||||
!in
|
||||
|
|
||||
false
|
||||
|
||||
listOf(" !in ")
|
||||
|
|
||||
@@ -25,14 +25,14 @@ assert(
|
||||
|
||||
Assertion failed
|
||||
assert("Hello"/*!in*/!in/*!in*/listOf("Hello", "World"))
|
||||
| |
|
||||
| [Hello, World]
|
||||
false
|
||||
| |
|
||||
| [Hello, World]
|
||||
false
|
||||
|
||||
Assertion failed
|
||||
assert(("Hello" !in listOf("Hello", "World")) !in listOf(false))
|
||||
| | |
|
||||
| | [false]
|
||||
| | | |
|
||||
| | | [false]
|
||||
| | false
|
||||
| [Hello, World]
|
||||
false
|
||||
false
|
||||
Reference in New Issue
Block a user