mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
[Win32] Negative length IO#sysread
Raise `ArgumentError` in `IO#sysread` on Windows when given a negative length. Fixes [Bug #18880]
This commit is contained in:
parent
472e7b8518
commit
684353fc03
Notes:
git
2022-09-11 23:08:39 +09:00
Merged: https://github.com/ruby/ruby/pull/6354 Merged-By: nobu <nobu@ruby-lang.org>
2 changed files with 10 additions and 1 deletions
|
@ -2213,6 +2213,14 @@ class TestIO < Test::Unit::TestCase
|
|||
end)
|
||||
end
|
||||
|
||||
def test_sysread_with_negative_length
|
||||
make_tempfile {|t|
|
||||
open(t.path) do |f|
|
||||
assert_raise(ArgumentError) { f.sysread(-1) }
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
def test_flag
|
||||
make_tempfile {|t|
|
||||
assert_raise(ArgumentError) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue