small updates to string_join:

use PyString_AS_STRING macro on local string object
    when resizing string, make sure resized string will always be big enough
    split string containing error message across two lines
add test to string_tests that causes resizing
This commit is contained in:
Jeremy Hylton 2000-07-11 20:55:38 +00:00
parent 672fac0d65
commit 88887aa38e
2 changed files with 12 additions and 6 deletions

View file

@ -123,6 +123,9 @@ def run_method_tests(test):
test('join', '.', u'a.b.c', ['a', u'b', 'c'])
test('join', '.', u'a.b.c', ['a', 'b', u'c'])
test('join', '.', TypeError, ['a', u'b', 3])
for i in [5, 25, 125]:
test('join', '-', ((('a' * i) + '-') * i)[:-1],
['a' * i] * i)
test('join', ' ', TypeError, BadSeq1())
test('join', ' ', 'a b c', BadSeq2())