mirror of
https://github.com/python/cpython
synced 2026-09-29 08:25:30 +03:00
New test cases for the StringIO module
This commit is contained in:
parent
89c528b02d
commit
b96e0e5e65
2 changed files with 24 additions and 0 deletions
9
Lib/test/output/test_StringIO
Normal file
9
Lib/test/output/test_StringIO
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
test_StringIO
|
||||
abcdefghij
|
||||
klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
|
||||
2
|
||||
abcdefghij
|
||||
klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
|
||||
2
|
||||
15
Lib/test/test_StringIO.py
Normal file
15
Lib/test/test_StringIO.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Tests StringIO and cStringIO
|
||||
|
||||
import string
|
||||
|
||||
def do_test(module):
|
||||
s = (string.letters+'\n')*5
|
||||
f = module.StringIO(s)
|
||||
print f.read(10)
|
||||
print f.readline()
|
||||
print len(f.readlines(60))
|
||||
|
||||
# Don't bother testing cStringIO without
|
||||
import StringIO, cStringIO
|
||||
do_test(StringIO)
|
||||
do_test(cStringIO)
|
||||
Loading…
Add table
Add a link
Reference in a new issue