diff options
author | Jeremy Bopp <[email protected]> | 2022-09-11 09:08:14 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-11 23:08:14 +0900 |
commit | 684353fc03afd6e7c887b65bd18f0b3aeb98101c (patch) | |
tree | 52f3a7e3874617604cf91578bf529803ee6ff8bb /test/ruby/test_io.rb | |
parent | 472e7b8518fbde98be3f0a06192a6695697bf879 (diff) |
[Win32] Negative length `IO#sysread`
Raise `ArgumentError` in `IO#sysread` on Windows when given a negative
length.
Fixes [Bug #18880]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6354
Merged-By: nobu <[email protected]>
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index d6fcf16ddd..f791b4415d 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -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 |