bpo-30603: Add test case to textwrap.dedent (GH-2014) · python/cpython@601483d (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 601483d

jonathaneuniceMariatta

authored and

committed

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 5 additions & 0 deletions

Original file line number Diff line number Diff line change
@@ -754,6 +754,11 @@ def foo():
754 754 expect = "Foo\n Bar\n\n Baz\n"
755 755 self.assertEqual(expect, dedent(text))
756 756
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 +
757 762 # dedent() should not mangle internal tabs
758 763 def test_dedent_preserve_internal_tabs(self):
759 764 text = " hello\tthere\n how are\tyou?"