summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_textwrap.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-10-28 19:39:36 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-10-28 19:39:36 (GMT)
commitfbe04b68af58ea513cf95cb45dc0d2656bd67cfc (patch)
tree447fd3b7c8d2050235d6e48210186d0aa659baae /Lib/test/test_textwrap.py
parent0a1ba709493656cb6f450c0ec3d07566185104b4 (diff)
downloadcpython-fbe04b68af58ea513cf95cb45dc0d2656bd67cfc.zip
cpython-fbe04b68af58ea513cf95cb45dc0d2656bd67cfc.tar.gz
cpython-fbe04b68af58ea513cf95cb45dc0d2656bd67cfc.tar.bz2
Issue #21827: Fixed textwrap.dedent() for the case when largest common
whitespace is a substring of smallest leading whitespace. Based on patch by Robert Li.
Diffstat (limited to 'Lib/test/test_textwrap.py')
-rw-r--r--Lib/test/test_textwrap.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py
index 7b72672..dccf095 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -647,6 +647,11 @@ def foo():
expect = "hello there\n how are you?"
self.assertEqual(expect, dedent(text))
+ # test margin is smaller than smallest indent
+ text = " \thello there\n \thow are you?\n \tI'm fine, thanks"
+ expect = " \thello there\n \thow are you?\n\tI'm fine, thanks"
+ self.assertEqual(expect, dedent(text))
+
def test_main():
test_support.run_unittest(WrapTestCase,