diff options
author | Jeremy Evans <code@jeremyevans.net> | 2022-05-26 10:45:36 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2022-06-09 08:22:06 -0700 |
commit | 27eb36596a65d6bca44b4420ca6526175bf1b431 (patch) | |
tree | 75bb323d54fa4b3b457784025ef018c99d3ee021 /test/ruby/test_io.rb | |
parent | 940c8b093de1d903b67b7d80cc33f698a5debf1c (diff) | |
download | ruby-27eb36596a65d6bca44b4420ca6526175bf1b431.tar.gz |
Stop ignoring 4th positional argument to IO.#{foreach,readlines}
Fixes [Bug #18771]
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index ed0198321d..0f42d8e164 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2596,6 +2596,8 @@ class TestIO < Test::Unit::TestCase assert_raise_with_message(IOError, /not opened for reading/, bug6054) do IO.foreach(t.path, mode:"w").next end + + assert_raise(ArgumentError, "[Bug #18771] [ruby-core:108503]") {IO.foreach(t, "\n", 10, true){}} } end @@ -2605,6 +2607,7 @@ class TestIO < Test::Unit::TestCase assert_equal(["foo\nb", "ar\nb", "az\n"], IO.readlines(t.path, "b")) assert_equal(["fo", "o\n", "ba", "r\n", "ba", "z\n"], IO.readlines(t.path, 2)) assert_equal(["fo", "o\n", "b", "ar", "\nb", "az", "\n"], IO.readlines(t.path, "b", 2)) + assert_raise(ArgumentError, "[Bug #18771] [ruby-core:108503]") {IO.readlines(t, "\n", 10, true){}} } end |