西山和広です。

ruby-bugs-jaのPR#415に投げた件も含めてruby-devにふり直します。

openのブロック中でcloseしているのでブロックから抜けるときに
IOErrorになります。

% ruby16 -ve 'File.open("/dev/null"){|f|f.close}'
ruby 1.6.8 (2003-03-26) [i686-linux]
% ruby18 -ve 'open("/dev/null"){|f|f.close}'
ruby 1.8.0 (2003-04-03) [i686-linux-gnu]
-e:1:in `close': closed stream (IOError)
        from -e:1:in `open'
        from -e:1
%


他にも1.8でいくつかtestに失敗します。

MatchData#to_aryとRange#to_aryは一度追加されたけど
なくなったということで良さそうですが、tc_proc.rb:68は
よくわかりませんでした。

cygwinでも実行してみたら、test_s_lchmodでのErrorが
増えました。


% ruby16 -v test.rb
ruby 1.6.8 (2003-03-26) [i686-linux]
./features/ruby18/tc_file.rb:86: warning: method redefined; discarding old test_s_lchmod
Loaded suite test
Started
............................/tmp/kazu/lib/ruby/site_ruby/1.6/features/ruby18/struct.rb:7: warning: method redefined; discarding old each_pair
/tmp/kazu/lib/ruby/site_ruby/1.6/features/ruby18/struct.rb:13: warning: method redefined; discarding old select
....................................................................
Finished in 3.088502 seconds.

68 tests, 322 assertions, 0 failures, 0 errors
% ruby18 -v test.rb
ruby 1.8.0 (2003-04-03) [i686-linux-gnu]
./features/ruby18/tc_file.rb:86: warning: method redefined; discarding old test_s_lchmod
Loaded suite test
Started
......................E..E.../features/ruby18/tc_object.rb:10: warning: Object#id will be deprecated; use Object#object_id
./features/ruby18/tc_object.rb:11: warning: Object#id will be deprecated; use Object#object_id
......................E..E.....E...........F..E.....................
Finished in 3.05871 seconds.

  1) Error!!!
test_fsync(TC_IO):
IOError: closed stream
    ./features/ruby18/tc_io.rb:39:in `close'
    ./features/ruby18/tc_io.rb:39:in `open'
    ./features/ruby18/tc_io.rb:39:in `test_fsync'
    test.rb:4

  2) Error!!!
test_s_read(TC_IO):
IOError: closed stream
    ./features/ruby18/tc_io.rb:28:in `close'
    ./features/ruby18/tc_io.rb:28:in `open'
    ./features/ruby18/tc_io.rb:28:in `test_s_read'
    test.rb:4

  3) Error!!!
test_to_ary(TC_MatchData):
NoMethodError: undefined method `to_ary' for #<MatchData:0x401a0cec>
    ./features/ruby18/tc_regexp.rb:69:in `test_to_ary'
    test.rb:4

  4) Failure!!!
test_yield_nest_2(TC_Proc) [./features/ruby18/tc_proc.rb:68]:
<2> expected but was
<[2]>

  5) Error!!!
test_to_ary(TC_Range):
NoMethodError: undefined method `to_ary' for "p".."r":Range
    ./features/ruby18/tc_range.rb:10:in `test_to_ary'
    test.rb:4

68 tests, 311 assertions, 1 failures, 4 errors
%


% ruby16 -v test.rb
ruby 1.6.8 (2002-12-13) [i686-cygwin]
./features/ruby18/tc_file.rb:86: warning: method redefined; discarding old test_
s_lchmod
Loaded suite test
Started
.................E........../tmp/kazu/lib/ruby/site_ruby/1.6/features/ruby18/str
uct.rb:7: warning: method redefined; discarding old each_pair
/tmp/kazu/lib/ruby/site_ruby/1.6/features/ruby18/struct.rb:13: warning: method r
edefined; discarding old select
........................................
Finished in 3.809 seconds.

  1) Error!!!
test_s_lchmod(TC_File):
Errno::EINVAL: Invalid argument - ".unit.test.symlink1"
    ./features/ruby18/tc_file.rb:92:in `lchown'
    ./features/ruby18/tc_file.rb:92:in `test_s_lchmod'
    test.rb:4

68 tests, 322 assertions, 0 failures, 1 errors
% ruby18 -v test.rb
ruby 1.8.0 (2003-03-31) [i386-cygwin]
./features/ruby18/tc_file.rb:86: warning: method redefined; discarding old test_
s_lchmod
Loaded suite test
Started
./features/ruby18/tc_hash.rb:14: warning: Insecure world writable dir /cygdrive/
c/PROGRA~1/JUSTSY~1/JSLIB32, mode 040777
.................E....E..E.../features/ruby18/tc_object.rb:10: warning: Object#i
d will be deprecated; use Object#object_id
./features/ruby18/tc_object.rb:11: warning: Object#id will be deprecated; use Ob
ject#object_id
...E...........F..E.....................
Finished in 3.461 seconds.

  1) Error!!!
test_s_lchmod(TC_File):
Errno::EINVAL: Invalid argument - ".unit.test.symlink1"
    ./features/ruby18/tc_file.rb:92:in `lchown'
    ./features/ruby18/tc_file.rb:92:in `test_s_lchmod'
    test.rb:4

  2) Error!!!
test_fsync(TC_IO):
IOError: closed stream
    ./features/ruby18/tc_io.rb:39:in `close'
    ./features/ruby18/tc_io.rb:39:in `open'
    ./features/ruby18/tc_io.rb:39:in `test_fsync'
    test.rb:4

  3) Error!!!
test_s_read(TC_IO):
IOError: closed stream
    ./features/ruby18/tc_io.rb:28:in `close'
    ./features/ruby18/tc_io.rb:28:in `open'
    ./features/ruby18/tc_io.rb:28:in `test_s_read'
    test.rb:4

  4) Error!!!
test_to_ary(TC_MatchData):
NoMethodError: undefined method `to_ary' for #<MatchData:0x100e4398>
    ./features/ruby18/tc_regexp.rb:69:in `test_to_ary'
    test.rb:4

  5) Failure!!!
test_yield_nest_2(TC_Proc) [./features/ruby18/tc_proc.rb:68]:
<2> expected but was
<[2]>

  6) Error!!!
test_to_ary(TC_Range):
NoMethodError: undefined method `to_ary' for "p".."r":Range
    ./features/ruby18/tc_range.rb:10:in `test_to_ary'
    test.rb:4

68 tests, 311 assertions, 1 failures, 5 errors
%

# shimとは関係ないけどJSLIB32の警告の消し方がわからない。
# XP Homeなのでプロパティでは変更できないし。

-- 
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)