summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Eunice <jonathan.eunice@gmail.com>2017-06-13 19:04:10 (GMT)
committerMariatta <Mariatta@users.noreply.github.com>2017-06-13 19:04:10 (GMT)
commit601483d3b8a0433ca25f7fd6beea2cef674be039 (patch)
tree88c26335699ad6504e4766100999769c4f1f28dc
parent049cf2bb44038351e1b2eed4fc7b1b522329e550 (diff)
downloadcpython-601483d3b8a0433ca25f7fd6beea2cef674be039.zip
cpython-601483d3b8a0433ca25f7fd6beea2cef674be039.tar.gz
cpython-601483d3b8a0433ca25f7fd6beea2cef674be039.tar.bz2
bpo-30603: Add test case to textwrap.dedent (GH-2014)
-rw-r--r--Lib/test/test_textwrap.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py
index 47d97bd..fe15348 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?"