From: Jonathan Eunice Date: Tue, 13 Jun 2017 19:04:10 +0000 (-0400) Subject: bpo-30603: Add test case to textwrap.dedent (GH-2014) X-Git-Tag: v3.7.0a1~600 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=601483d3b8a0433ca25f7fd6beea2cef674be039;p=python bpo-30603: Add test case to textwrap.dedent (GH-2014) --- diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py index 47d97bda86..fe15348aff 100644 --- a/Lib/test/test_textwrap.py +++ b/Lib/test/test_textwrap.py @@ -754,6 +754,11 @@ def foo(): expect = "Foo\n Bar\n\n Baz\n" self.assertEqual(expect, dedent(text)) + # Uneven indentation with declining indent level. + text = " Foo\n Bar\n" # 5 spaces, then 4 + expect = " Foo\nBar\n" + self.assertEqual(expect, dedent(text)) + # dedent() should not mangle internal tabs def test_dedent_preserve_internal_tabs(self): text = " hello\tthere\n how are\tyou?"