summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-30 14:14:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-30 14:14:46 +0000
commit77ed5993fe6effc60c9a735c2b7b3aabf586af92 (patch)
tree610099df7a9e32c30bd3bce9cae5fd38503228a0 /test
parent875cea02664aab8c51a97edbbc5f22fbd2e88bd2 (diff)
* io.c (rb_io_each_byte): rbuf can be refreshed during yield.
[Bug #5119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 0325867496..4276157a20 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]'