From 321346cfa5fca9da246d83588fbaae2f79fc6069 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 30 Jul 2011 14:14:46 +0000 Subject: * io.c (rb_io_each_byte): rbuf can be refreshed during yield. [Bug #5119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index c62edbba00..d4787c75b4 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -235,6 +235,16 @@ class TestIO < Test::Unit::TestCase end) end + def test_each_byte_with_seek + t = make_tempfile + bug5119 = '[ruby-core:38609]' + i = 0 + open(t.path) do |f| + f.each_byte {i = f.pos} + end + assert_equal(12, i, bug5119) + end + def test_each_codepoint t = make_tempfile bug2959 = '[ruby-core:28650]' -- cgit v1.2.3