Skip to content

Commit 01ae992

Browse files
committed
Add test for IO.binread and .copy_stream in the case of length is nil
1 parent b147cbb commit 01ae992

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/stdlib/IO_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def test_binread
1515
IO, :binread, File.expand_path(__FILE__), 3
1616
assert_send_type "(String, Integer, Integer) -> String",
1717
IO, :binread, File.expand_path(__FILE__), 3, 0
18+
assert_send_type "(String, Integer?, Integer) -> String",
19+
IO, :binread, File.expand_path(__FILE__), nil, 3
1820
end
1921

2022
def test_binwrite
@@ -88,6 +90,8 @@ def test_copy_stream
8890
IO, :copy_stream, src_name, dst_name, 1
8991
assert_send_type "(String, String, Integer, Integer) -> Integer",
9092
IO, :copy_stream, src_name, dst_name, 1, 0
93+
assert_send_type "(String, String, Integer?, Integer) -> Integer",
94+
IO, :copy_stream, src_name, dst_name, nil, 1
9195

9296
File.open(dst_name, "w") do |dst_io|
9397
assert_send_type "(String, IO) -> Integer",

0 commit comments

Comments
 (0)