mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-07 05:14:29 +08:00
Fix an issue in the diff parser about endmarker newlines
This was discovered in https://github.com/davidhalter/jedi/issues/1000.
This commit is contained in:
@@ -484,3 +484,21 @@ def test_indentation_issue(differ):
|
||||
|
||||
differ.initialize(code1)
|
||||
differ.parse(code2, parsers=2)
|
||||
|
||||
|
||||
def test_endmarker_newline(differ):
|
||||
code1 = dedent('''\
|
||||
docu = None
|
||||
# some comment
|
||||
result = codet
|
||||
incomplete_dctassign = {
|
||||
"module"
|
||||
|
||||
if "a":
|
||||
x = 3 # asdf
|
||||
''')
|
||||
|
||||
code2 = code1.replace('codet', 'coded')
|
||||
|
||||
differ.initialize(code1)
|
||||
differ.parse(code2, parsers=2, copies=2, expect_error_leaves=True)
|
||||
|
||||
Reference in New Issue
Block a user