bpo-30603: Add test case to textwrap.dedent (GH-2014) · python/cpython@601483d (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 601483d
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?" |