summaryrefslogtreecommitdiffstatshomepage
path: root/tests/io/stringio1.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/io/stringio1.py')
-rw-r--r--tests/io/stringio1.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/io/stringio1.py b/tests/io/stringio1.py
new file mode 100644
index 0000000000..f69f62f75f
--- /dev/null
+++ b/tests/io/stringio1.py
@@ -0,0 +1,30 @@
+import io
+
+a = io.StringIO()
+print(a.getvalue())
+print(a.read())
+
+a = io.StringIO("foobar")
+print(a.getvalue())
+print(a.read())
+print(a.read())
+
+a = io.StringIO()
+a.write("foo")
+print(a.getvalue())
+
+a = io.StringIO("foo")
+a.write("12")
+print(a.getvalue())
+
+a = io.StringIO("foo")
+a.write("123")
+print(a.getvalue())
+
+a = io.StringIO("foo")
+a.write("1234")
+print(a.getvalue())
+
+a = io.StringIO()
+a.write("foo")
+print(a.read())