summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2017-06-12 16:15:31 +0900
committerGitHub <[email protected]>2017-06-12 16:15:31 +0900
commitc279f00109267346d3df3bcf0c513aecf2f1bb6e (patch)
tree23f546dc1c0efff9332b4075fbb11603028b03f1 /test
parent0b41066e83ace09f57f6e42cbd78b931f30a0307 (diff)
parent051d7bc8dbfca584789ae8e9c1c393aea3aa72b7 (diff)
downloadmruby-c279f00109267346d3df3bcf0c513aecf2f1bb6e.tar.gz
mruby-c279f00109267346d3df3bcf0c513aecf2f1bb6e.zip
Merge pull request #86 from ksss/write
Reseek when write
Diffstat (limited to 'test')
-rw-r--r--test/io.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/io.rb b/test/io.rb
index b654ff213..f1dd7afe8 100644
--- a/test/io.rb
+++ b/test/io.rb
@@ -181,6 +181,16 @@ assert('IO#write', '15.2.20.5.20') do
io = IO.open(IO.sysopen($mrbtest_io_wfname))
assert_equal 0, io.write("")
io.close
+
+ io = IO.open(IO.sysopen($mrbtest_io_wfname, "r+"), "r+")
+ assert_equal 7, io.write("abcdefg")
+ io.rewind
+ assert_equal "ab", io.read(2)
+ assert_equal 3, io.write("123")
+ io.rewind
+ assert_equal "ab123fg", io.read
+ io.close
+
true
end