From: Guido van Rossum Date: Thu, 12 Oct 2000 16:46:28 +0000 (+0000) Subject: Added a test for the StringIO write() error I just fixed. X-Git-Tag: v2.0~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22d5895dc337bb457dba6ce3623d835f32f32962;p=python Added a test for the StringIO write() error I just fixed. --- diff --git a/Lib/test/output/test_StringIO b/Lib/test/output/test_StringIO index e2c5c31aea..e2b28931c5 100644 --- a/Lib/test/output/test_StringIO +++ b/Lib/test/output/test_StringIO @@ -3,6 +3,7 @@ abcdefghij klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 2 +'abcuvwxyz!' 'abcdefghij' 'abcde' Caught expected ValueError writing to closed StringIO: @@ -11,6 +12,7 @@ abcdefghij klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 2 +'abcuvwxyz!' 'abcdefghij' 'abcde' Caught expected ValueError writing to closed StringIO: diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py index b1fca84e70..ea237cd138 100644 --- a/Lib/test/test_StringIO.py +++ b/Lib/test/test_StringIO.py @@ -7,6 +7,13 @@ def do_test(module): print f.readline() print len(f.readlines(60)) + f = module.StringIO() + f.write('abcdef') + f.seek(3) + f.write('uvwxyz') + f.write('!') + print `f.getvalue()` + f.close() f = module.StringIO() f.write(s) f.seek(10)