mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Added tests for the new .isalpha() and .isalnum() methods.
This commit is contained in:
parent
f03e74126e
commit
9d4674168f
2 changed files with 31 additions and 0 deletions
|
@ -84,6 +84,21 @@ test('istitle', 'Not a capitalized String', 0)
|
|||
test('istitle', 'Not\ta Titlecase String', 0)
|
||||
test('istitle', 'Not--a Titlecase String', 0)
|
||||
|
||||
test('isalpha', 'a', 1)
|
||||
test('isalpha', 'A', 1)
|
||||
test('isalpha', '\n', 0)
|
||||
test('isalpha', 'abc', 1)
|
||||
test('isalpha', 'aBc123', 0)
|
||||
test('isalpha', 'abc\n', 0)
|
||||
|
||||
test('isalnum', 'a', 1)
|
||||
test('isalnum', 'A', 1)
|
||||
test('isalnum', '\n', 0)
|
||||
test('isalnum', '123abc456', 1)
|
||||
test('isalnum', 'a1b3c', 1)
|
||||
test('isalnum', 'aBc000 ', 0)
|
||||
test('isalnum', 'abc\n', 0)
|
||||
|
||||
test('splitlines', "abc\ndef\n\rghi", ['abc', 'def', '', 'ghi'])
|
||||
test('splitlines', "abc\ndef\n\r\nghi", ['abc', 'def', '', 'ghi'])
|
||||
test('splitlines', "abc\ndef\r\nghi", ['abc', 'def', 'ghi'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue