mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
10 lines
351 B
Python
10 lines
351 B
Python
import io
|
|
import tokenize
|
|
|
|
# Pending f-string parts must use the correct source line after CRLF lines.
|
|
source = 'pass\r\npass\r\nf"a}}b"\r\n'
|
|
tokens = list(tokenize.generate_tokens(io.StringIO(source).readline))
|
|
parts = [tok for tok in tokens if tok.type == tokenize.FSTRING_MIDDLE]
|
|
assert parts
|
|
assert all(tok.line == 'f"a}}b"\r\n' for tok in parts)
|