Patch #1581073: add a flag to textwrap that prevents the dropping of

whitespace while wrapping.
This commit is contained in:
Georg Brandl 2007-03-13 18:15:41 +00:00
parent 92a6baed7b
commit 9e6b47002a
4 changed files with 26 additions and 4 deletions

View file

@ -328,6 +328,14 @@ What a mess!
self.check_wrap(text, 30,
[" This is a sentence with", "leading whitespace."])
def test_no_drop_whitespace(self):
# SF patch #1581073
text = " This is a sentence with much whitespace."
self.check_wrap(text, 10,
[" This is a", " ", "sentence ",
"with ", "much white", "space."],
drop_whitespace=False)
if test_support.have_unicode:
def test_unicode(self):
# *Very* simple test of wrapping Unicode strings. I'm sure