diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 02:12:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 02:12:59 +0000 |
commit | 2e5d698538ea132a4dcd46d924c071227b5f4956 (patch) | |
tree | ddba6a83c3c52d1aefaa3c136d3543354462e7ca /test/ruby/test_io.rb | |
parent | bfd63b28b5bdbad1663acab9f0a42c6ec9723809 (diff) | |
download | ruby-2e5d698538ea132a4dcd46d924c071227b5f4956.tar.gz |
io.c: no error on frozen IO
* io.c (rb_io_fileno, rb_io_inspect): non-modification does not
error on frozen IO. [ruby-dev:48241] [Bug #9865]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-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 79a4bb4599..0d5671a267 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1122,6 +1122,8 @@ class TestIO < Test::Unit::TestCase def test_inspect with_pipe do |r, w| assert_match(/^#<IO:fd \d+>$/, r.inspect) + r.freeze + assert_match(/^#<IO:fd \d+>$/, r.inspect) end end @@ -2786,6 +2788,14 @@ End assert_equal(2, $stderr.fileno) end + def test_frozen_fileno + bug9865 = '[ruby-dev:48241] [Bug #9865]' + with_pipe do |r,w| + fd = r.fileno + assert_equal(fd, r.freeze.fileno, bug9865) + end + end + def test_sysread_locktmp bug6099 = '[ruby-dev:45297]' buf = " " * 100 |