From e60951a3052d4e38dea21566feb02cf901b6646a Mon Sep 17 00:00:00 2001 From: Tomoyuki Sahara Date: Tue, 29 Jul 2014 10:55:02 +0900 Subject: add IO#sync and IO#sync= --- test/io.rb | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'test') 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)) -- cgit v1.2.3