diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-30 14:14:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-30 14:14:46 +0000 |
commit | 321346cfa5fca9da246d83588fbaae2f79fc6069 (patch) | |
tree | bb54c08733787e0d4d631c7d625fb224877bbf24 /test/ruby | |
parent | cf310f97416686e93841e202462c8bb60fb332e6 (diff) | |
download | ruby-321346cfa5fca9da246d83588fbaae2f79fc6069.tar.gz |
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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]' |