summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_textwrap.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-10-28 19:43:12 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-10-28 19:43:12 (GMT)
commitf8152c67f52874cd4aa63f1cb3e1216382f98057 (patch)
tree40df18ddb09e88f3a17b771bc8adaecf2ecb2ec7 /Lib/test/test_textwrap.py
parent44b1020c121aa5511e8994496ee4e7a2ad9deb8d (diff)
parentea4cb63e68d96697ff8eb9ea86da6158f27b95a2 (diff)
downloadcpython-f8152c67f52874cd4aa63f1cb3e1216382f98057.zip
cpython-f8152c67f52874cd4aa63f1cb3e1216382f98057.tar.gz
cpython-f8152c67f52874cd4aa63f1cb3e1216382f98057.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 707aaaa..a44184f 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -748,6 +748,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))
+
# Test textwrap.indent
class IndentTestCase(unittest.TestCase):