[Python-checkins] python/dist/src/Lib/test string_tests.py,1.14,1.15 test_unicode.py,1.56,1.57
doerwalter@sourceforge.net
doerwalter@sourceforge.net
Mon, 22 Apr 2002 10:42:39 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv30740/Lib/test
Modified Files:
string_tests.py test_unicode.py
Log Message:
Apply patch diff.txt from SF feature request
http://www.python.org/sf/444708
This adds the optional argument for str.strip
to unicode.strip too and makes it possible
to call str.strip with a unicode argument
and unicode.strip with a str argument.
Index: string_tests.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/string_tests.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** string_tests.py 16 Apr 2002 01:38:40 -0000 1.14
--- string_tests.py 22 Apr 2002 17:42:37 -0000 1.15
***************
*** 170,178 ****
test('strip', 'hello', 'hello', None)
! # strip/lstrip/rstrip with real arg
test('strip', 'xyzzyhelloxyzzy', 'hello', 'xyz')
test('lstrip', 'xyzzyhelloxyzzy', 'helloxyzzy', 'xyz')
test('rstrip', 'xyzzyhelloxyzzy', 'xyzzyhello', 'xyz')
test('strip', 'hello', 'hello', 'xyz')
test('swapcase', 'HeLLo cOmpUteRs', 'hEllO CoMPuTErS')
--- 170,184 ----
test('strip', 'hello', 'hello', None)
! # strip/lstrip/rstrip with str arg
test('strip', 'xyzzyhelloxyzzy', 'hello', 'xyz')
test('lstrip', 'xyzzyhelloxyzzy', 'helloxyzzy', 'xyz')
test('rstrip', 'xyzzyhelloxyzzy', 'xyzzyhello', 'xyz')
test('strip', 'hello', 'hello', 'xyz')
+
+ # strip/lstrip/rstrip with unicode arg
+ test('strip', 'xyzzyhelloxyzzy', u'hello', u'xyz')
+ test('lstrip', 'xyzzyhelloxyzzy', u'helloxyzzy', u'xyz')
+ test('rstrip', 'xyzzyhelloxyzzy', u'xyzzyhello', u'xyz')
+ test('strip', 'hello', u'hello', u'xyz')
test('swapcase', 'HeLLo cOmpUteRs', 'hEllO CoMPuTErS')
Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** test_unicode.py 17 Apr 2002 21:34:05 -0000 1.56
--- test_unicode.py 22 Apr 2002 17:42:37 -0000 1.57
***************
*** 170,173 ****
--- 170,191 ----
test('strip', u'hello', u'hello')
+ # strip/lstrip/rstrip with None arg
+ test('strip', u' hello ', u'hello', None)
+ test('lstrip', u' hello ', u'hello ', None)
+ test('rstrip', u' hello ', u' hello', None)
+ test('strip', u'hello', u'hello', None)
+
+ # strip/lstrip/rstrip with unicode arg
+ test('strip', u'xyzzyhelloxyzzy', u'hello', u'xyz')
+ test('lstrip', u'xyzzyhelloxyzzy', u'helloxyzzy', u'xyz')
+ test('rstrip', u'xyzzyhelloxyzzy', u'xyzzyhello', u'xyz')
+ test('strip', u'hello', u'hello', u'xyz')
+
+ # strip/lstrip/rstrip with str arg
+ test('strip', u'xyzzyhelloxyzzy', u'hello', 'xyz')
+ test('lstrip', u'xyzzyhelloxyzzy', u'helloxyzzy', 'xyz')
+ test('rstrip', u'xyzzyhelloxyzzy', u'xyzzyhello', 'xyz')
+ test('strip', u'hello', u'hello', 'xyz')
+
test('swapcase', u'HeLLo cOmpUteRs', u'hEllO CoMPuTErS')