diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-26 20:26:14 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-26 20:26:14 +0300 |
commit | cb9dc086a34a501dd05c439277eb79c93c4c02a0 (patch) | |
tree | 5727cdbae2cf222e008a778250f9f908785037bf /tests | |
parent | dbc81df5d4822b3a0fc31ea1c5684b0101e193dd (diff) | |
download | micropython-cb9dc086a34a501dd05c439277eb79c93c4c02a0.tar.gz micropython-cb9dc086a34a501dd05c439277eb79c93c4c02a0.zip |
modio: Implement io.StringIO class.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/io/stringio1.py | 30 |
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()) |