[Python-checkins] python/dist/src/Lib/test test_unicode.py,1.63,1.64

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Fri, 09 Aug 2002 08:36:50 -0700


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

Modified Files:
	test_unicode.py 
Log Message:
Unicode replace() method with empty pattern argument should fail, like
it does for 8-bit strings.


Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** test_unicode.py	6 Aug 2002 23:08:51 -0000	1.63
--- test_unicode.py	9 Aug 2002 15:36:48 -0000	1.64
***************
*** 207,210 ****
--- 207,216 ----
  test('replace', u'one!two!three!', u'one!two!three!', u'x', u'@')
  test('replace', u'one!two!three!', u'one!two!three!', u'x', u'@', 2)
+ try:
+     u"abc".replace(u"", u"x")
+ except ValueError:
+     pass
+ else:
+     raise TestFailed, "u.replace('', ...) should raise ValueError"
  
  test('startswith', u'hello', True, u'he')