diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-26 22:24:45 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-26 22:24:45 +0100 |
commit | 36cbd0db7e4f297c8fc729c842b171af2cfd04c7 (patch) | |
tree | 82b3d45a68a649548701bb3240712c4c385a490a /tests/io/stringio1.py | |
parent | 32bef315be8e56ad2d7f69223fe7b9606893b6ab (diff) | |
parent | 27f5bdd6d4a5653004368983ced1e9cda25d1baf (diff) |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'tests/io/stringio1.py')
-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 000000000..f69f62f75 --- /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()) |