mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
IO#syswrite should raise an error if it's not opened for writing.
This commit is contained in:
+6
-1
@@ -92,7 +92,12 @@ assert('IO.sysopen, IO#syswrite') do
|
||||
len = io.syswrite(str)
|
||||
assert_equal str.size, len
|
||||
io.close
|
||||
io.closed?
|
||||
|
||||
io = IO.new(IO.sysopen($mrbtest_io_rfname), "r")
|
||||
assert_raise(IOError) { io.syswrite("a") }
|
||||
io.close
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
assert('IO#_read_buf') do
|
||||
|
||||
Reference in New Issue
Block a user