diff options
author | Barry Warsaw <barry@python.org> | 1999-06-14 18:38:42 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1999-06-14 18:38:42 (GMT) |
commit | d5258681e7838d8c0e16b9b3448ce4105340ea79 (patch) | |
tree | 17ace36752782aed98a5dfcfe8b91f99a2397861 /Lib/test/test_string.py | |
parent | cbfa5cbcc84af09d00bd013a6a896c7c864d8ee1 (diff) | |
download | cpython-d5258681e7838d8c0e16b9b3448ce4105340ea79.zip cpython-d5258681e7838d8c0e16b9b3448ce4105340ea79.tar.gz cpython-d5258681e7838d8c0e16b9b3448ce4105340ea79.tar.bz2 |
Added more tests of join
Diffstat (limited to 'Lib/test/test_string.py')
-rw-r--r-- | Lib/test/test_string.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py index 73ece8e..1ec29f8 100644 --- a/Lib/test/test_string.py +++ b/Lib/test/test_string.py @@ -67,6 +67,15 @@ class Sequence: test('join', ['a', 'b', 'c', 'd'], 'a b c d') test('join', ('a', 'b', 'c', 'd'), 'abcd', '') test('join', Sequence(), 'w x y z') +test('join', 7, TypeError) + +class BadStr: + def __str__(self): raise RuntimeError + +class BadSeq(Sequence): + def __init__(self): self.seq = [7, 'hello', BadStr()] + +test('join', BadSeq(), RuntimeError) # try a few long ones print string.join(['x' * 100] * 100, ':') |