mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
#13152: Allow to specify a custom tabsize for expanding tabs in textwrap
Patch by John Feuerstein.
This commit is contained in:
parent
d34b57a9a2
commit
d527259f14
4 changed files with 29 additions and 4 deletions
|
@ -91,6 +91,14 @@ What a mess!
|
|||
result = wrapper.fill(text)
|
||||
self.check(result, '\n'.join(expect))
|
||||
|
||||
text = "\tTest\tdefault\t\ttabsize."
|
||||
expect = [" Test default tabsize."]
|
||||
self.check_wrap(text, 80, expect)
|
||||
|
||||
text = "\tTest\tcustom\t\ttabsize."
|
||||
expect = [" Test custom tabsize."]
|
||||
self.check_wrap(text, 80, expect, tabsize=4)
|
||||
|
||||
def test_fix_sentence_endings(self):
|
||||
wrapper = TextWrapper(60, fix_sentence_endings=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue