[Python-checkins] CVS: python/dist/src/Lib/test test_strop.py,1.11,1.12

Tim Peters tim_one@users.sourceforge.net
Wed, 09 May 2001 18:23:41 -0700


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

Modified Files:
	test_strop.py 
Log Message:
Guido has Spoken.  Restore strop.replace()'s treatment of a 0 count as
meaning infinity -- but at least warn about it in the code!  I pissed
away a couple hours on this today, and don't wish the same on the next
in line.
Bugfix candidate.


Index: test_strop.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strop.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** test_strop.py	2001/05/10 00:59:45	1.11
--- test_strop.py	2001/05/10 01:23:39	1.12
***************
*** 78,82 ****
  test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3)
  test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4)
! test('replace', 'one!two!three!', 'one!two!three!', '!', '@', 0)
  test('replace', 'one!two!three!', 'one@two@three@', '!', '@')
  test('replace', 'one!two!three!', 'one!two!three!', 'x', '@')
--- 78,84 ----
  test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3)
  test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4)
! # CAUTION:  a replace count of 0 means infinity only to strop, not to the
! # string .replace() method or to the string.replace() function.
! test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 0)
  test('replace', 'one!two!three!', 'one@two@three@', '!', '@')
  test('replace', 'one!two!three!', 'one!two!three!', 'x', '@')