mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-07 13:24:39 +08:00
Fix split lines for Python code
Some characters like Vertical Tab or File Separator were used as line separators. This is not legal. Line Separators in Python are only Carriage Return \r and Line Feed \n.
This commit is contained in:
@@ -29,6 +29,12 @@ import pytest
|
||||
|
||||
('\r', ['', ''], False),
|
||||
('\r', ['\r', ''], True),
|
||||
|
||||
# Invalid line breaks
|
||||
('a\vb', ['a\vb'], False),
|
||||
('a\vb', ['a\vb'], True),
|
||||
('\x1C', ['\x1C'], False),
|
||||
('\x1C', ['\x1C'], True),
|
||||
]
|
||||
)
|
||||
def test_split_lines(string, expected_result, keepends):
|
||||
|
||||
Reference in New Issue
Block a user