summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_textwrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_textwrap.py')
-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 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."