Fix diff parser get_last_line calculation

This commit is contained in:
Dave Halter
2018-12-31 01:25:11 +01:00
parent 0126a38bd1
commit 750b8af37b
2 changed files with 29 additions and 0 deletions

View File

@@ -579,3 +579,29 @@ def test_add_error_indentation(differ):
code = 'if x:\n 1\n'
differ.initialize(code)
differ.parse(code + ' 2\n', parsers=1, copies=0, expect_error_leaves=True)
def test_differing_docstrings(differ):
code1 = dedent('''\
def foobar(x, y):
1
return x
def bazbiz():
foobar()
lala
''')
code2 = dedent('''\
def foobar(x, y):
2
return x + y
def bazbiz():
z = foobar()
lala
''')
differ.initialize(code1)
differ.parse(code2, parsers=3, copies=1)
differ.parse(code1, parsers=3, copies=1)