]> granicus.if.org Git - python/commitdiff
Added more tests of join
authorBarry Warsaw <barry@python.org>
Mon, 14 Jun 1999 18:38:42 +0000 (18:38 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 14 Jun 1999 18:38:42 +0000 (18:38 +0000)
Lib/test/test_string.py

index 73ece8ed2bf1f7296cda832953c9dbe2841a06e2..1ec29f80ffdfa3919592dd9710bb420c9df4953a 100644 (file)
@@ -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, ':')