From 49128575e801bfc1726e2bf4a022cd2e15224ecc Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Wed, 7 May 2003 00:54:42 +0000 Subject: SF #726446: ensure wrap() raises ValueError when width <= 0. --- Lib/test/test_textwrap.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py index b8964dc..0f7f567 100644 --- a/Lib/test/test_textwrap.py +++ b/Lib/test/test_textwrap.py @@ -262,6 +262,12 @@ What a mess! ["Hello", " ", "there", " ", "--", " ", "you", " ", "goof-", "ball,", " ", "use", " ", "the", " ", "-b", " ", "option!"]) + def test_bad_width(self): + # Ensure that width <= 0 is caught. + text = "Whatever, it doesn't matter." + self.assertRaises(ValueError, wrap, text, 0) + self.assertRaises(ValueError, wrap, text, -1) + class LongWordTestCase (BaseTestCase): def setUp(self): -- cgit v0.12