diff options
| author | Tomoyuki Sahara <[email protected]> | 2014-07-29 10:55:02 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2014-07-29 10:55:02 +0900 |
| commit | e60951a3052d4e38dea21566feb02cf901b6646a (patch) | |
| tree | 3057bc3837f46db7adaac0397ba065b2311f40b9 /test | |
| parent | 1768ee02e5b74c2a54fa312550700ed469f7b7db (diff) | |
| download | mruby-e60951a3052d4e38dea21566feb02cf901b6646a.tar.gz mruby-e60951a3052d4e38dea21566feb02cf901b6646a.zip | |
add IO#sync and IO#sync=
Diffstat (limited to 'test')
| -rw-r--r-- | test/io.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/io.rb b/test/io.rb index cbe3cd2b0..006c7cc8d 100644 --- a/test/io.rb +++ b/test/io.rb @@ -120,8 +120,28 @@ end #assert('IO#readline', '15.2.20.5.16') do #assert('IO#readlines', '15.2.20.5.17') do -#assert('IO#sync', '15.2.20.5.18') do -#assert('IO#sync=', '15.2.20.5.19') do + +assert('IO#sync', '15.2.20.5.18') do + io = IO.new(IO.sysopen($mrbtest_io_rfname)) + s = io.sync + assert_true(s == true || s == false) + io.close + assert_raise(IOError) do + io.sync + end +end + +assert('IO#sync=', '15.2.20.5.19') do + io = IO.new(IO.sysopen($mrbtest_io_rfname)) + io.sync = true + assert_true io.sync + io.sync = false + assert_false io.sync + io.close + assert_raise(IOError) do + io.sync = true + end +end assert('IO#write', '15.2.20.5.20') do io = IO.open(IO.sysopen($mrbtest_io_wfname)) |
