summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTOMITA Masahiro <tommy@tmtm.org>2025-11-27 11:10:43 +0900
committerGitHub <noreply@github.com>2025-11-27 15:10:43 +1300
commit2e770cdf773d79327cfdeb8178a1cb9b340f4560 (patch)
tree018ec8588024cfc038701a6e45bc4007c6a995a4 /test/ruby
parenta60cd8787cb65a6077f609652f6042143d81b227 (diff)
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.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io_buffer.rb1
1 files changed, 1 insertions, 0 deletions
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