diff options
author | Georg Brandl <georg@python.org> | 2008-05-11 10:42:28 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-11 10:42:28 (GMT) |
commit | 6f95ae55b151f366396e7d99b829c27f27259a89 (patch) | |
tree | 25a01ff82606387d250413114e3a7bd446222da5 /Lib/test/test_textwrap.py | |
parent | 5b54887debc860f1b394c5c706c09ca4a93732f8 (diff) | |
download | cpython-6f95ae55b151f366396e7d99b829c27f27259a89.zip cpython-6f95ae55b151f366396e7d99b829c27f27259a89.tar.gz cpython-6f95ae55b151f366396e7d99b829c27f27259a89.tar.bz2 |
#2659: add ``break_on_hyphens`` to TextWrapper.
Diffstat (limited to 'Lib/test/test_textwrap.py')
-rw-r--r-- | Lib/test/test_textwrap.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py index c1c09f6..1eab90c 100644 --- a/Lib/test/test_textwrap.py +++ b/Lib/test/test_textwrap.py @@ -364,6 +364,14 @@ What a mess! ["Hello", " ", "there", " ", "--", " ", "you", " ", "goof-", "ball,", " ", "use", " ", "the", " ", "-b", " ", "option!"]) + def test_break_on_hyphens(self): + # Ensure that the break_on_hyphens attributes work + text = "yaba daba-doo" + self.check_wrap(text, 10, ["yaba daba-", "doo"], + break_on_hyphens=True) + self.check_wrap(text, 10, ["yaba", "daba-doo"], + break_on_hyphens=False) + def test_bad_width(self): # Ensure that width <= 0 is caught. text = "Whatever, it doesn't matter." |