mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	SF #726446: ensure wrap() raises ValueError when width <= 0.
This commit is contained in:
		
							parent
							
								
									c8d2290c8c
								
							
						
					
					
						commit
						49128575e8
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -262,6 +262,12 @@ def test_split(self):
 | 
				
			||||||
             ["Hello", " ", "there", " ", "--", " ", "you", " ", "goof-",
 | 
					             ["Hello", " ", "there", " ", "--", " ", "you", " ", "goof-",
 | 
				
			||||||
              "ball,", " ", "use", " ", "the", " ", "-b", " ",  "option!"])
 | 
					              "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):
 | 
					class LongWordTestCase (BaseTestCase):
 | 
				
			||||||
    def setUp(self):
 | 
					    def setUp(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue