Issue #9072 has been reported by akr (Akira Tanaka).

----------------------------------------
Bug #9072: test_weakref.rb failure
https://bugs.ruby-lang.org/issues/9072

Author: akr (Akira Tanaka)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.1.0dev (2013-11-01 trunk 43510) [i686-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


test_weakref.rb ?????????????????????以???????????失?????????????

boron% ./ruby -v -e 'load("test/test_weakref.rb")' 
ruby 2.1.0dev (2013-11-01 trunk 43510) [i686-linux]
test/test_weakref.rb:19: warning: assigned but unused variable - str
Run options: 

# Running tests:

[2/4] TestWeakRef#test_recycled = 0.01 s                              
  1) Failure:
TestWeakRef#test_recycled [test/test_weakref.rb:25]:
Expected "." to not be weakref_alive?.

Finished tests in 0.140466s, 28.4766 tests/s, 64.0724 assertions/s.
4 tests, 9 assertions, 1 failures, 0 errors, 0 skips

ruby -v: ruby 2.1.0dev (2013-11-01 trunk 43510) [i686-linux]

????????????????????????????????????
????????????? weakref_alive? ??????????確???????????????????????
test/test_weakref.rb ??以??????????? p ???????????????????

  def test_recycled
    weak, str = make_weakref
    assert_nothing_raised(WeakRef::RefError) {weak.to_s}
    assert_predicate(weak, :weakref_alive?)
    ObjectSpace.garbage_collect
    ObjectSpace.garbage_collect
    assert_raise(WeakRef::RefError) {weak.to_s}
    p weak.weakref_alive?
    assert_not_predicate(weak, :weakref_alive?)
  end

????????????????以????????????????????????

boron% ./ruby -v -e 'load("test/test_weakref.rb")'
ruby 2.1.0dev (2013-11-01 trunk 43510) [i686-linux]
test/test_weakref.rb:19: warning: assigned but unused variable - str
Run options: 

# Running tests:

[2/4] TestWeakRef#test_recyclednil                                    
 = 0.01 s
  1) Failure:
TestWeakRef#test_recycled [test/test_weakref.rb:26]:
Expected [] to not be weakref_alive?.

Finished tests in 0.164603s, 24.3009 tests/s, 54.6770 assertions/s.
4 tests, 9 assertions, 1 failures, 0 errors, 0 skips

ruby -v: ruby 2.1.0dev (2013-11-01 trunk 43510) [i686-linux]

weakref_alive? ??? nil ??????????????????????????????????????????????
?????????????????Expected ??次???????????? "." ?????? [] ?????????????????????????

?????????????????? p ???????????????????

  def test_recycled
    weak, str = make_weakref
    assert_nothing_raised(WeakRef::RefError) {weak.to_s}
    assert_predicate(weak, :weakref_alive?)
    ObjectSpace.garbage_collect
    ObjectSpace.garbage_collect
    assert_raise(WeakRef::RefError) {weak.to_s}
    p weak.weakref_alive?
    p weak.weakref_alive?
    assert_not_predicate(weak, :weakref_alive?)
  end

??????????????以???????????????????????

boron% ./ruby -v -e 'load("test/test_weakref.rb")' 
ruby 2.1.0dev (2013-11-01 trunk 43510) [i686-linux]
test/test_weakref.rb:19: warning: assigned but unused variable - str
Run options: 

# Running tests:

[2/4] TestWeakRef#test_recyclednil                                    
nil
 = 0.01 s
  1) Failure:
TestWeakRef#test_recycled [test/test_weakref.rb:27]:
Expected {Object=>:never} to not be weakref_alive?.

Finished tests in 0.140746s, 28.4200 tests/s, 63.9450 assertions/s.
4 tests, 9 assertions, 1 failures, 0 errors, 0 skips

ruby -v: ruby 2.1.0dev (2013-11-01 trunk 43510) [i686-linux]

Expected ??次?????????????度?? {Object=>:never} ??????????????

?????????????????Expected ??次???????????????????????????????????????????????????????????????????




-- 
http://bugs.ruby-lang.org/