[Python-checkins] python/dist/src/Lib/test test_textwrap.py,1.20,1.21

gward@users.sourceforge.net gward@users.sourceforge.net
Tue, 06 May 2003 18:19:24 -0700


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

Modified Files:
	test_textwrap.py 
Log Message:
SF #596434: add test_funky_parens() to probe some more of the tricky
edge cases that David Goodger reported long ago (July 2002?).


Index: test_textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** test_textwrap.py	7 May 2003 00:54:42 -0000	1.20
--- test_textwrap.py	7 May 2003 01:19:22 -0000	1.21
***************
*** 225,233 ****
          self.check_split("--text--.", ["--text--."])
  
!         # My initial mis-interpretation of part of the bug report --
!         # These were always handled correctly, but it can't hurt to make
!         # sure that they *stay* correct!
          self.check_split("--option", ["--option"])
          self.check_split("--option-opt", ["--option-", "opt"])
  
      def test_initial_whitespace(self):
--- 225,249 ----
          self.check_split("--text--.", ["--text--."])
  
!         # When I first read bug #596434, this is what I thought David
!         # was talking about.  I was wrong; these have always worked
!         # fine.  The real problem is tested in test_funky_parens()
!         # below...
          self.check_split("--option", ["--option"])
          self.check_split("--option-opt", ["--option-", "opt"])
+         self.check_split("foo --option-opt bar",
+                          ["foo", " ", "--option-", "opt", " ", "bar"])
+ 
+     def test_funky_parens (self):
+         # Second part of SF bug #596434: long option strings inside
+         # parentheses.
+         self.check_split("foo (--option) bar",
+                          ["foo", " ", "(--option)", " ", "bar"])
+ 
+         # Related stuff -- make sure parens work in simpler contexts.
+         self.check_split("foo (bar) baz",
+                          ["foo", " ", "(bar)", " ", "baz"])
+         self.check_split("blah (ding dong), wubba",
+                          ["blah", " ", "(ding", " ", "dong),",
+                           " ", "wubba"])
  
      def test_initial_whitespace(self):