New test cases for the StringIO module
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 19 Sep 2000 16:35:39 +0000 (16:35 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 19 Sep 2000 16:35:39 +0000 (16:35 +0000)
Lib/test/output/test_StringIO [new file with mode: 0644]
Lib/test/test_StringIO.py [new file with mode: 0644]

diff --git a/Lib/test/output/test_StringIO b/Lib/test/output/test_StringIO
new file mode 100644 (file)
index 0000000..505023a
--- /dev/null
@@ -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 (file)
index 0000000..6e321e9
--- /dev/null
@@ -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)