aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-14 19:41:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-14 19:41:32 +0000
commit32ed00ab188cf46d0d4bae116a48dac91731af32 (patch)
treef9e7dc3edc0e4ac9e6890ddae690c0f720a53437 /test/ruby/test_io.rb
parentad130d3670bc9ef423ccf93c2b6988f988359b29 (diff)
downloadruby-32ed00ab188cf46d0d4bae116a48dac91731af32.tar.gz
* io.c (rb_io_each_codepoint): read directly when readconv is
needed but internal encoding is not set. [ruby-core:28650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-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 5fc3b133dd..a8860e1654 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -150,6 +150,16 @@ class TestIO < Test::Unit::TestCase
r.close
end
+ def test_each_codepoint
+ t = make_tempfile
+ bug2959 = '[ruby-core:28650]'
+ a = ""
+ File.open(t, 'rt') {|f|
+ f.each_codepoint {|c| a << c}
+ }
+ assert_equal("foo\nbar\nbaz\n", a, bug2959)
+ end
+
def test_rubydev33072
assert_raise(Errno::ENOENT, "[ruby-dev:33072]") do
File.read("empty", nil, nil, {})