mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
SequenceMatcher(None, [], []).get_grouped_opcodes() now returns a generator
that behaves as if both lists has an empty string in each of them. Closes bug #979794 (and duplicate bug #980117).
This commit is contained in:
parent
b8e1717041
commit
d2c5b4b549
3 changed files with 13 additions and 0 deletions
|
@ -12,6 +12,13 @@ class TestSFbugs(unittest.TestCase):
|
|||
self.assertEqual(s.quick_ratio(), 1)
|
||||
self.assertEqual(s.real_quick_ratio(), 1)
|
||||
|
||||
def test_comparing_empty_lists(self):
|
||||
# Check fix for bug #979794
|
||||
group_gen = difflib.SequenceMatcher(None, [], []).get_grouped_opcodes()
|
||||
self.assertRaises(StopIteration, group_gen.next)
|
||||
diff_gen = difflib.unified_diff([], [])
|
||||
self.assertRaises(StopIteration, diff_gen.next)
|
||||
|
||||
Doctests = doctest.DocTestSuite(difflib)
|
||||
|
||||
test_support.run_unittest(TestSFbugs, Doctests)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue