summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_difflib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2018-04-05 18:19:57 (GMT)
committerGitHub <noreply@github.com>2018-04-05 18:19:57 (GMT)
commit01b731fc2b04744a11e32f93aba8bfb9ddb3dd29 (patch)
tree0128472a7e425a2b6e5bef94204db0eeaa226b25 /Lib/test/test_difflib.py
parent7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6 (diff)
downloadcpython-01b731fc2b04744a11e32f93aba8bfb9ddb3dd29.zip
cpython-01b731fc2b04744a11e32f93aba8bfb9ddb3dd29.tar.gz
cpython-01b731fc2b04744a11e32f93aba8bfb9ddb3dd29.tar.bz2
bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381)
Diffstat (limited to 'Lib/test/test_difflib.py')
-rw-r--r--Lib/test/test_difflib.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py
index aaefe6d..745ccbd 100644
--- a/Lib/test/test_difflib.py
+++ b/Lib/test/test_difflib.py
@@ -93,6 +93,14 @@ class TestSFbugs(unittest.TestCase):
self.assertEqual("+ \t\tI am a bug", diff[2])
self.assertEqual("? +\n", diff[3])
+ def test_mdiff_catch_stop_iteration(self):
+ # Issue #33224
+ self.assertEqual(
+ list(difflib._mdiff(["2"], ["3"], 1)),
+ [((1, '\x00-2\x01'), (1, '\x00+3\x01'), True)],
+ )
+
+
patch914575_from1 = """
1. Beautiful is beTTer than ugly.
2. Explicit is better than implicit.