16 Commits

Author SHA1 Message Date
Sergej Jaskiewicz 0008e832d8 [PowerAssert] Improve the accuracy of locating infix operator tokens
Use KotlinLexer to determine the correct offset of an infix operator
token instead of skipping whitespaces after the operator's LHS.

This fixes cases like this:

```
assert("Name"/*in*/in/*in*/listOf("Hello", "World"))
              |            |
              |            [Hello, World]
              false
```
2024-03-05 18:54:06 +00:00
Sergej Jaskiewicz 54c58671fb [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
2024-03-05 18:54:06 +00:00
Sergej Jaskiewicz 7d22825176 [PowerAssert] Reproduce KT-66208 2024-03-05 18:54:06 +00:00
Brian Norman 721d02f4f3 [PowerAssert] Find the earliest starting offset for receiver expression
Calls of infix functions have a start offset which doesn't include the
receiver. Property accessors have a start offset at the start of the
property name and do not include their receiver expression. This
combination can cause problems when the entire expression needs to be
displayed, including the entirety of a complex receiver. Make sure to
navigate expressions to find their earliest starting offset and use that
instead.

^KT-65810 Fixed
2024-02-29 15:10:09 +00:00
Brian Norman d53d5dddc5 [PowerAssert] Add tests to recreate KT-65810 2024-02-29 15:10:09 +00:00
Brian Norman 78bb0be7aa [FIR2IR] Propagate NOT_IN statement origin when converting to IR
^KT-65636 Fixed
2024-02-29 15:10:09 +00:00
Brian Norman 6d634ac87f [PowerAssert] Mark project tests as using JUnit 5 2024-02-29 15:10:09 +00:00
Brian Norman f0268721c1 [PowerAssert] Use OS path separator to parse JUnit5 classpath property 2024-02-29 15:10:09 +00:00
Brian Norman 027474cfb8 [PowerAssert] Correctly align infix calls with string const receivers
^KT-65640 Fixed
2024-02-29 15:10:09 +00:00
Dmitriy Novozhilov acf2296590 [Test] Regenerate tests after two previous commits 2024-02-16 12:48:24 +00:00
Brian Norman 305c53dd6e [PowerAssert] Add codegen tests 2024-02-07 21:51:17 +00:00
Brian Norman aa34282efb [PowerAssert] Integrate with build
^KT-63617 Fixed
2024-02-07 21:51:17 +00:00
Brian Norman c3a60b127e [PowerAssert] Reformat files 2024-02-07 21:51:17 +00:00
Brian Norman 2de0c8b23f [PowerAssert] Update file copyright 2024-02-07 21:51:17 +00:00
Brian Norman d8167fe82b [PowerAssert] Update base package 2024-02-07 21:51:17 +00:00
Brian Norman f9bcd697da Prepare kotlin-power-assert files for git merge with Kotlin 2023-11-22 15:53:49 -06:00