From: Martin v. Löwis Date: Tue, 19 Sep 2000 16:35:39 +0000 (+0000) Subject: New test cases for the StringIO module X-Git-Tag: v2.0b2~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b96e0e5e65e957235f2b4e4aeaf3041f590af014;p=thirdparty%2FPython%2Fcpython.git New test cases for the StringIO module --- diff --git a/Lib/test/output/test_StringIO b/Lib/test/output/test_StringIO new file mode 100644 index 000000000000..505023a7bc4b --- /dev/null +++ b/Lib/test/output/test_StringIO @@ -0,0 +1,9 @@ +test_StringIO +abcdefghij +klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + +2 +abcdefghij +klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + +2 diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py new file mode 100644 index 000000000000..6e321e930f7e --- /dev/null +++ b/Lib/test/test_StringIO.py @@ -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)