From 601483d3b8a0433ca25f7fd6beea2cef674be039 Mon Sep 17 00:00:00 2001 From: Jonathan Eunice Date: Tue, 13 Jun 2017 15:04:10 -0400 Subject: [PATCH] bpo-30603: Add test case to textwrap.dedent (GH-2014) --- Lib/test/test_textwrap.py | 5 +++++ 1 file changed, 5 insertions(+) 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?" -- 2.50.1