Index: Lib/test/test_difflib.py =================================================================== --- Lib/test/test_difflib.py (revision 54269) +++ Lib/test/test_difflib.py (working copy) @@ -150,6 +150,15 @@ old = [(i%2 and "K:%d" or "V:A:%d") % i for i in range(limit*2)] new = [(i%2 and "K:%d" or "V:B:%d") % i for i in range(limit*2)] difflib.SequenceMatcher(None, old, new).get_opcodes() + + def test_find_longest_match(self): + # Check if the problem described in bug #1528074 exists. + for i in (190, 200, 210): + text1 = "a" + "b"*i + text2 = "b"*i + "c" + m = difflib.SequenceMatcher(None, text1, text2) + (aptr,bptr,l) = m.find_longest_match(0, len(text1), 0, len(text2)) + assert i == l + assert aptr == 1 + assert bptr == 0 def test_main():