Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_difflib.py @ 57411:f554dfff7450 legacy-trunk
Fix for issue1488943 - difflib.Differ() doesn't always add hints for tab
characters.
| author | Senthil Kumaran <orsenthil@gmail.com> |
|---|---|
| date | Mon, 23 Nov 2009 18:41:31 +0000 |
| parents | 70fb848870ac |
| children | 713f1f6bf339 |
line wrap: on
line diff
--- a/Lib/test/test_difflib.py Mon Nov 23 16:39:05 2009 +0000 +++ b/Lib/test/test_difflib.py Mon Nov 23 18:41:31 2009 +0000 @@ -20,6 +20,14 @@ diff_gen = difflib.unified_diff([], []) self.assertRaises(StopIteration, diff_gen.next) + def test_added_tab_hint(self): + # Check fix for bug #1488943 + diff = list(difflib.Differ().compare(["\tI am a buggy"],["\t\tI am a bug"])) + self.assertEqual("- \tI am a buggy", diff[0]) + self.assertEqual("? --\n", diff[1]) + self.assertEqual("+ \t\tI am a bug", diff[2]) + self.assertEqual("? +\n", diff[3]) + patch914575_from1 = """ 1. Beautiful is beTTer than ugly. 2. Explicit is better than implicit.
