summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2012-05-19 11:33:11 (GMT)
committerHynek Schlawack <hs@ox.cx>2012-05-19 11:33:11 (GMT)
commitd527259f14dd6094f0a417ea83e66b8f233e38a3 (patch)
treecdafd33bae9ac524e1c99a2f4e72a31fca25d4c1 /Lib/test
parentd34b57a9a2810e79d6f6aa7dc12832c4e4b214a5 (diff)
downloadcpython-d527259f14dd6094f0a417ea83e66b8f233e38a3.zip
cpython-d527259f14dd6094f0a417ea83e66b8f233e38a3.tar.gz
cpython-d527259f14dd6094f0a417ea83e66b8f233e38a3.tar.bz2
#13152: Allow to specify a custom tabsize for expanding tabs in textwrap
Patch by John Feuerstein.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_textwrap.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py
index 905dd4c..bbd0882 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -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)