mirror of
https://github.com/davidhalter/parso.git
synced 2026-10-01 07:23:46 +08:00
Fix diff parser: get_last_line was sometimes wrong
Now the calculation is way simpler. Still annoying that it even happened.
This commit is contained in:
1 parent
64cf24d9da
commit
d2542983e9
2 files changed
+38
-13
No files matched your search
@@ -609,3 +609,34 @@ def test_differing_docstrings(differ):
|
||||
differ.initialize(code1)
|
||||
differ.parse(code2, parsers=3, copies=1)
|
||||
differ.parse(code1, parsers=3, copies=1)
|
||||
|
||||
|
||||
def test_one_call_in_function_change(differ):
|
||||
code1 = dedent('''\
|
||||
def f(self):
|
||||
mro = [self]
|
||||
for a in something:
|
||||
yield a
|
||||
|
||||
def g(self):
|
||||
return C(
|
||||
a=str,
|
||||
b=self,
|
||||
)
|
||||
''')
|
||||
|
||||
code2 = dedent('''\
|
||||
def f(self):
|
||||
mro = [self]
|
||||
|
||||
def g(self):
|
||||
return C(
|
||||
a=str,
|
||||
t
|
||||
b=self,
|
||||
)
|
||||
''')
|
||||
|
||||
differ.initialize(code1)
|
||||
differ.parse(code2, parsers=1, copies=1, expect_error_leaves=True)
|
||||
differ.parse(code1, parsers=2, copies=1)
|
||||
Reference in new issue
Block a user