From 2e770cdf773d79327cfdeb8178a1cb9b340f4560 Mon Sep 17 00:00:00 2001 From: TOMITA Masahiro Date: Thu, 27 Nov 2025 11:10:43 +0900 Subject: Fix argument handling in `IO::Buffer#each_byte` (#15309) The method incorrectly ignored its first argument and treated the second argument as offset and the third as count. This change makes the first argument be treated as offset and the second as count. Also fix incorrect block parameter in comments. --- test/ruby/test_io_buffer.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test/ruby') diff --git a/test/ruby/test_io_buffer.rb b/test/ruby/test_io_buffer.rb index 997ed52640..1e4a6e2fd8 100644 --- a/test/ruby/test_io_buffer.rb +++ b/test/ruby/test_io_buffer.rb @@ -473,6 +473,7 @@ class TestIOBuffer < Test::Unit::TestCase buffer = IO::Buffer.for(string) assert_equal string.bytes, buffer.each_byte.to_a + assert_equal string.bytes[3, 5], buffer.each_byte(3, 5).to_a end def test_zero_length_each_byte -- cgit v1.2.3