summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-08-21 18:59:26 (GMT)
committerTim Peters <tim.peters@gmail.com>2019-08-21 18:59:25 (GMT)
commite1c638da6a065af6803028ced1afcc679e63f59d (patch)
treee885eff0ee7b9188e180f81820261da56ca6ec37 /Lib/test
parent092911d5c0d8f6db8a0cb02fecd73dbb650f9e2e (diff)
downloadcpython-e1c638da6a065af6803028ced1afcc679e63f59d.zip
cpython-e1c638da6a065af6803028ced1afcc679e63f59d.tar.gz
cpython-e1c638da6a065af6803028ced1afcc679e63f59d.tar.bz2
Fix difflib `?` hint in diff output when dealing with tabs (#15201)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_difflib.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py
index 745ccbd..5e2ca1a 100644
--- a/Lib/test/test_difflib.py
+++ b/Lib/test/test_difflib.py
@@ -89,10 +89,16 @@ class TestSFbugs(unittest.TestCase):
# 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 --\n", diff[1])
self.assertEqual("+ \t\tI am a bug", diff[2])
self.assertEqual("? +\n", diff[3])
+ def test_hint_indented_properly_with_tabs(self):
+ diff = list(difflib.Differ().compare(["\t \t \t^"], ["\t \t \t^\n"]))
+ self.assertEqual("- \t \t \t^", diff[0])
+ self.assertEqual("+ \t \t \t^\n", diff[1])
+ self.assertEqual("? \t \t \t +\n", diff[2])
+
def test_mdiff_catch_stop_iteration(self):
# Issue #33224
self.assertEqual(