diff options
author | Marc-André Lemburg <mal@egenix.com> | 2000-07-05 09:46:40 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2000-07-05 09:46:40 (GMT) |
commit | 9d4674168fa41b9b9e1968b69f42681ce61ca610 (patch) | |
tree | 0e24fac1d62469ae27a51962972bef4b2929189b /Lib/test/test_string.py | |
parent | f03e74126e5702edab33148140e84d21471424ce (diff) | |
download | cpython-9d4674168fa41b9b9e1968b69f42681ce61ca610.zip cpython-9d4674168fa41b9b9e1968b69f42681ce61ca610.tar.gz cpython-9d4674168fa41b9b9e1968b69f42681ce61ca610.tar.bz2 |
Added tests for the new .isalpha() and .isalnum() methods.
Diffstat (limited to 'Lib/test/test_string.py')
-rw-r--r-- | Lib/test/test_string.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py index ec57c26..c7c3e72 100644 --- a/Lib/test/test_string.py +++ b/Lib/test/test_string.py @@ -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']) |