[Python-checkins] python/dist/src/Lib/test test_difflib.py, 1.9,
1.10
bcannon at users.sourceforge.net
bcannon at users.sourceforge.net
Sun Jul 11 01:54:10 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26258/Lib/test
Modified Files:
test_difflib.py
Log Message:
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).
Index: test_difflib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_difflib.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_difflib.py 18 Jan 2004 20:29:55 -0000 1.9
--- test_difflib.py 10 Jul 2004 23:54:07 -0000 1.10
***************
*** 13,16 ****
--- 13,23 ----
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)
More information about the Python-checkins
mailing list