Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_string.py @ 10981:17ec0902eafa legacy-trunk
Added more tests of join
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Mon, 14 Jun 1999 18:38:42 +0000 |
| parents | 2ec04ff2b9b7 |
| children | e39a9f129163 |
line wrap: on
line diff
--- a/Lib/test/test_string.py Mon Jun 14 15:40:23 1999 +0000 +++ b/Lib/test/test_string.py Mon Jun 14 18:38:42 1999 +0000 @@ -67,6 +67,15 @@ 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, ':')
