diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-28 05:55:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-28 05:55:05 +0000 |
commit | 20da239464cc91e921cbb98d903d29622919fdcd (patch) | |
tree | e9f2232b4834dc1e83e7371be28eafab55778e44 /test | |
parent | c4ad649e070dcb1011747d30cee084520bd79a70 (diff) | |
download | ruby-20da239464cc91e921cbb98d903d29622919fdcd.tar.gz |
io.c: preserve encodings
* io.c (rb_io_s_new): preserve encodings in warning messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 126100e096..08f39c3a4a 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2282,7 +2282,12 @@ End end def test_new_with_block - assert_in_out_err([], "r, w = IO.pipe; IO.new(r) {}", [], /^.+$/) + assert_in_out_err([], "r, w = IO.pipe; IO.new(r.fileno) {}", [], /^.+$/) + n = "IO\u{5165 51fa 529b}" + c = eval("class #{n} < IO; self; end") + IO.pipe do |r, w| + assert_warning(/#{n}/) {c.new(r.fileno) {}} + end end def test_readline2 |