ruff/crates/ruff_python_parser/tests
Dhruv Manilawala d930e97212
Do not include newline for unterminated string range (#12017)
## Summary

This PR updates the unterminated string error range to not include the
final newline character.

This is a follow-up to #12016 and required for #12019

This is not done for when the unterminated string goes till the end of
file (not a newline character). The unterminated f-string range is
correct.

### Why is this required for #12019 ?

Because otherwise the token ranges will overlap. For example:
```py
f"{"
f"{foo!r"
```

Here, the re-lexing logic recovers from an unterminated f-string and
thus emitting a `Newline` token for the one at the end of the first
line. But, currently the `Unknown` and the `Newline` token would overlap
because the `Unknown` token (unterminated string literal) range would
include the newline character.

## Test Plan

Update and validate the snapshot.
2024-06-25 08:10:07 +00:00
..
snapshots Do not include newline for unterminated string range (#12017) 2024-06-25 08:10:07 +00:00
fixtures.rs Update E999 to show all syntax errors (#11900) 2024-06-19 13:09:54 +05:30
generate_inline_tests.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30