[Python-checkins] python/dist/src/Lib/test test_textwrap.py,1.3,1.4

gward@users.sourceforge.net gward@users.sourceforge.net
Thu, 22 Aug 2002 11:45:05 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv11185

Modified Files:
	test_textwrap.py 
Log Message:
Simplify and reformat the use of 'subcases' lists (and following
for-loops) in test_simple(), test_wrap_short() test_hyphenated(), and
test_funky_punc().


Index: test_textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_textwrap.py	22 Aug 2002 18:37:50 -0000	1.3
--- test_textwrap.py	22 Aug 2002 18:45:02 -0000	1.4
***************
*** 46,68 ****
  
          subcases = [
!             ( (t, 12), [
!                 "Hello there,",
!                 "how are you",
!                 "this fine",
!                 "day?  I'm",
!                 "glad to hear",
!                 "it!" 
!                 ] ),
!             ( (t, 42), [ 
!                 "Hello there, how are you this fine day?",
!                 "I'm glad to hear it!"
!                 ] ),
!             ( (t, 80), [ 
!                 t 
!                 ] ),
              ]
  
!         for test, expect in subcases:
!             result = wrap(*test)
              self.check(result, expect)
  
--- 46,62 ----
  
          subcases = [
!             (12, ["Hello there,",
!                   "how are you",
!                   "this fine",
!                   "day?  I'm",
!                   "glad to hear",
!                   "it!"]),
!             (42, ["Hello there, how are you this fine day?",
!                   "I'm glad to hear it!"]),
!             (80, [t]),
              ]
  
!         for width, expect in subcases:
!             result = wrap(t, width)
              self.check(result, expect)
  
***************
*** 100,114 ****
  
          subcases = [
!             ( (t, 20), [
!                 "This is a short",
!                 "paragraph."
!                 ] ),
!             ( (t, 40), [
!                 "This is a short paragraph."
!                 ] ),
              ]
  
!         for test, expect in subcases:
!             result = wrap(*test)
              self.check(result, expect)
  
--- 94,104 ----
  
          subcases = [
!             (20, ["This is a short",
!                   "paragraph."]),
!             (40, ["This is a short paragraph."]),
              ]
  
!         for width, expect in subcases:
!             result = wrap(t, width)
              self.check(result, expect)
  
***************
*** 120,139 ****
  
          subcases = [
!             ( (t, 40), [
!                 "this-is-a-useful-feature-for-",
!                 "reformatting-posts-from-tim-peters'ly"
!                 ] ),
!             ( (t, 41), [
!                 "this-is-a-useful-feature-for-",
!                 "reformatting-posts-from-tim-peters'ly"
!                 ] ),
!             ( (t, 42), [
!                 "this-is-a-useful-feature-for-reformatting-",
!                 "posts-from-tim-peters'ly"
!                 ] ),
              ]
  
!         for test, expect in subcases:
!             result = wrap(*test)
              self.check(result, expect)
  
--- 110,123 ----
  
          subcases = [
!             (40, ["this-is-a-useful-feature-for-",
!                   "reformatting-posts-from-tim-peters'ly"]),
!             (41, ["this-is-a-useful-feature-for-",
!                   "reformatting-posts-from-tim-peters'ly"]),
!             (42, ["this-is-a-useful-feature-for-reformatting-",
!                   "posts-from-tim-peters'ly"]),
              ]
  
!         for width, expect in subcases:
!             result = wrap(t, width)
              self.check(result, expect)
  
***************
*** 159,176 ****
  '''
          subcases = [
!             ( (t, 30), [
!                 'Did you say "supercalifragilis',
!                 'ticexpialidocious?" How *do*',
!                 'you spell that odd word,',
!                 'anyways?' 
!                 ] ),
!             ( (t, 50), [
!                 'Did you say "supercalifragilisticexpialidocious?"',
!                 'How *do* you spell that odd word, anyways?'
!                 ] ),
              ]
  
!         for test, expect in subcases:
!             result = wrap(*test)
              self.check(result, expect)
  
--- 143,156 ----
  '''
          subcases = [
!             (30, ['Did you say "supercalifragilis',
!                   'ticexpialidocious?" How *do*',
!                   'you spell that odd word,',
!                   'anyways?']),
!             (50, ['Did you say "supercalifragilisticexpialidocious?"',
!                   'How *do* you spell that odd word, anyways?']),
              ]
  
!         for width, expect in subcases:
!             result = wrap(t, width)
              self.check(result, expect)