diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2009-11-23 18:41:31 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2009-11-23 18:41:31 (GMT) |
commit | 5c456e6f4571fec64a98e28e7e316972f35d19fc (patch) | |
tree | c8d68f50c39733465208de8d1f8cfe551c003444 /Lib/test/test_difflib.py | |
parent | f058d2dc0835eecf75c1d93d77e8e3b7c372a862 (diff) | |
download | cpython-5c456e6f4571fec64a98e28e7e316972f35d19fc.zip cpython-5c456e6f4571fec64a98e28e7e316972f35d19fc.tar.gz cpython-5c456e6f4571fec64a98e28e7e316972f35d19fc.tar.bz2 |
Fix for issue1488943 - difflib.Differ() doesn't always add hints for tab
characters.
Diffstat (limited to 'Lib/test/test_difflib.py')
-rw-r--r-- | Lib/test/test_difflib.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py index 011ef17..93f5c74 100644 --- a/Lib/test/test_difflib.py +++ b/Lib/test/test_difflib.py @@ -20,6 +20,14 @@ class TestSFbugs(unittest.TestCase): 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. |