summaryrefslogtreecommitdiff
path: root/Lib/test/test_textwrap.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-10-28 21:39:36 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-10-28 21:39:36 +0200
commit5ed10e53bc783567f859eb41052dad29d419b7a0 (patch)
treee13e053368e6093baa017a78554a84504eda5345 /Lib/test/test_textwrap.py
parentc6b8f0105afa4a62a382d132f03aae1b3564e93d (diff)
downloadcpython-5ed10e53bc783567f859eb41052dad29d419b7a0.tar.gz
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 1bba77eb9e..ea7c0895c1 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -732,6 +732,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):