mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
68b6874f59
commit
ea4cb63e68
4 changed files with 18 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue