mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
a7cc43b9e8
commit
de02bcb265
6 changed files with 243 additions and 80 deletions
|
@ -169,12 +169,18 @@ def run_method_tests(test):
|
|||
test('rstrip', ' hello ', ' hello', None)
|
||||
test('strip', 'hello', 'hello', None)
|
||||
|
||||
# strip/lstrip/rstrip with real arg
|
||||
# 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')
|
||||
test('translate', 'xyzabcdef', 'xyzxyz', transtable, 'def')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue