Kaydet (Commit) 22d5895d authored tarafından Guido van Rossum's avatar Guido van Rossum

Added a test for the StringIO write() error I just fixed.

üst b636dc67
...@@ -3,6 +3,7 @@ abcdefghij ...@@ -3,6 +3,7 @@ abcdefghij
klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
2 2
'abcuvwxyz!'
'abcdefghij' 'abcdefghij'
'abcde' 'abcde'
Caught expected ValueError writing to closed StringIO: Caught expected ValueError writing to closed StringIO:
...@@ -11,6 +12,7 @@ abcdefghij ...@@ -11,6 +12,7 @@ abcdefghij
klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
2 2
'abcuvwxyz!'
'abcdefghij' 'abcdefghij'
'abcde' 'abcde'
Caught expected ValueError writing to closed StringIO: Caught expected ValueError writing to closed StringIO:
......
...@@ -7,6 +7,13 @@ def do_test(module): ...@@ -7,6 +7,13 @@ def do_test(module):
print f.readline() print f.readline()
print len(f.readlines(60)) 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 = module.StringIO()
f.write(s) f.write(s)
f.seek(10) f.seek(10)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment