bpo-30603: Add test case to textwrap.dedent (GH-2014)

This commit is contained in:
Jonathan Eunice 2017-06-13 15:04:10 -04:00 committed by Mariatta
parent 049cf2bb44
commit 601483d3b8
1 changed files with 5 additions and 0 deletions

View File

@ -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?"