Skip to content

Commit 601483d

Browse files
jonathaneuniceMariatta
authored andcommitted
bpo-30603: Add test case to textwrap.dedent (GH-2014)
1 parent 049cf2b commit 601483d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/test_textwrap.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,11 @@ def foo():
754754
expect = "Foo\n Bar\n\n Baz\n"
755755
self.assertEqual(expect, dedent(text))
756756

757+
# Uneven indentation with declining indent level.
758+
text = " Foo\n Bar\n" # 5 spaces, then 4
759+
expect = " Foo\nBar\n"
760+
self.assertEqual(expect, dedent(text))
761+
757762
# dedent() should not mangle internal tabs
758763
def test_dedent_preserve_internal_tabs(self):
759764
text = " hello\tthere\n how are\tyou?"

0 commit comments

Comments
 (0)