From 3c03385e2e5f4d1d87c5ebcd35c92a41619c9f96 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sat, 11 Apr 2020 11:18:47 +0900 Subject: Check the file descriptor with `IO#initialize`; resolve #4966 --- mrbgems/mruby-io/test/io.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mrbgems/mruby-io/test') diff --git a/mrbgems/mruby-io/test/io.rb b/mrbgems/mruby-io/test/io.rb index 458d2cdc2..2088a61e3 100644 --- a/mrbgems/mruby-io/test/io.rb +++ b/mrbgems/mruby-io/test/io.rb @@ -24,6 +24,10 @@ def assert_io_open(meth) end end io2.close unless meth == :open + + assert_raise(RuntimeError) { IO.__send__(meth, 1023) } # For Windows + assert_raise(RuntimeError) { IO.__send__(meth, 1 << 26) } + assert_raise(RuntimeError) { IO.__send__(meth, 1 << 32) } if (1 << 32).kind_of?(Integer) end end -- cgit v1.2.3