[Python-checkins] python/dist/src/Lib/test test_textwrap.py,1.15,1.16
gward@users.sourceforge.net
gward@users.sourceforge.net
Thu, 31 Oct 2002 08:11:21 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv14403
Modified Files:
test_textwrap.py
Log Message:
Ad test_funky_hyphens() to test some screwy edge cases reported in SF
bug #596434. (Alas, I don't think this completely covers that bug.)
Remove 'wrapper' argument from BaseTestCase.check_split() -- it's not
actually needed.
Index: test_textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** test_textwrap.py 2 Oct 2002 15:47:32 -0000 1.15
--- test_textwrap.py 31 Oct 2002 16:11:18 -0000 1.16
***************
*** 38,43 ****
self.check(result, expect)
! def check_split(self, wrapper, text, expect):
! result = wrapper._split(text)
self.assertEquals(result, expect,
"\nexpected %r\n"
--- 38,43 ----
self.check(result, expect)
! def check_split(self, text, expect):
! result = self.wrapper._split(text)
self.assertEquals(result, expect,
"\nexpected %r\n"
***************
*** 175,184 ****
"and", "--", "here's", " ", "another", "---",
"and", " ", "another!"]
! self.check_split(self.wrapper, text, expect)
text = "and then--bam!--he was gone"
expect = ["and", " ", "then", "--", "bam!", "--",
"he", " ", "was", " ", "gone"]
! self.check_split(self.wrapper, text, expect)
--- 175,184 ----
"and", "--", "here's", " ", "another", "---",
"and", " ", "another!"]
! self.check_split(text, expect)
text = "and then--bam!--he was gone"
expect = ["and", " ", "then", "--", "bam!", "--",
"he", " ", "was", " ", "gone"]
! self.check_split(text, expect)
***************
*** 215,219 ****
expect = ["the", " ", "-n", " ", "option,", " ", "or", " ",
"--dry-", "run", " ", "or", " ", "--dryrun"]
! self.check_split(self.wrapper, text, expect)
def test_split(self):
--- 215,232 ----
expect = ["the", " ", "-n", " ", "option,", " ", "or", " ",
"--dry-", "run", " ", "or", " ", "--dryrun"]
! self.check_split(text, expect)
!
! def test_funky_hyphens (self):
! # Screwy edge cases cooked up by David Goodger. All reported
! # in SF bug #596434.
! self.check_split("what the--hey!", ["what", " ", "the", "--", "hey!"])
! self.check_split("what the--", ["what", " ", "the--"])
! self.check_split("what the--.", ["what", " ", "the--."])
! self.check_split("--text--.", ["--text--."])
!
! # I think David got this wrong in the bug report, but it can't
! # hurt to make sure it stays right!
! self.check_split("--option", ["--option"])
! self.check_split("--option-opt", ["--option-", "opt"])
def test_split(self):