diff options
| author | Tomoyuki Sahara <[email protected]> | 2013-08-30 19:09:36 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2013-08-30 19:09:36 +0900 |
| commit | 47a610e688c4e7eac3267e5fd776b7032406fdae (patch) | |
| tree | c4fd3fd27ac6d80f874eb500ebe41fd193f96e46 /test | |
| parent | 713aa48cf91d96022fbb73c117260d653a83dac2 (diff) | |
| download | mruby-47a610e688c4e7eac3267e5fd776b7032406fdae.tar.gz mruby-47a610e688c4e7eac3267e5fd776b7032406fdae.zip | |
use array parameter on IO.open.
Diffstat (limited to 'test')
| -rw-r--r-- | test/io.rb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/test/io.rb b/test/io.rb index 315f3ea79..77b6bc430 100644 --- a/test/io.rb +++ b/test/io.rb @@ -1,6 +1,10 @@ ## # IO Test +assert('IO TEST SETUP') do + MRubyIOTestUtil.io_test_setup +end + assert('IO', '15.2.20') do assert_equal(Class, IO.class) end @@ -13,6 +17,22 @@ assert('IO', '15.2.20.3') do assert_include(IO.included_modules, Enumerable) end +assert('IO.open', '15.2.20.4.1') do + fd = IO.sysopen $mrbtest_io_rfname + assert_equal Fixnum, fd.class + io = IO.open fd + assert_equal IO, io.class + assert_equal $mrbtest_io_msg+"\n", io.read + io.close + + fd = IO.sysopen $mrbtest_io_rfname + IO.open(fd) do |io| + assert_equal $mrbtest_io_msg+"\n", io.read + end + + true +end + assert('IO.new') do IO.new(0) end @@ -21,10 +41,6 @@ assert('IO gc check') do 100.times { IO.new(0) } end -assert('IO TEST SETUP') do - MRubyIOTestUtil.io_test_setup -end - assert('IO.sysopen, IO#close, IO#closed?') do fd = IO.sysopen $mrbtest_io_rfname assert_equal Fixnum, fd.class |
