[Ruby 1.9-Bug#4159][Open] test block variables(TestRipper::ParserEvents) が失敗する

Bug #4159: test_block_variables(TestRipper::ParserEvents) が失敗する
http://redmine.ruby-lang.org/issues/show/4159

起票者: Kouhei Y.
ステータス: Open, 優先度: Normal
ruby -v: ruby 1.9.3dev (2010-12-14 trunk 30209) [x86_64-linux]

test_block_variables(TestRipper::ParserEvents) が失敗することがあります。
どうも環境依存らしく、CentOS 5.5のマシンでは再現しますが、Debian lennyのマシンでは再現しません。

$ make test-all TESTS="-n test_block_variables
ripper/test_parser_events.rb"
./miniruby -I./lib -I.ext/common ./tool/runruby.rb --extout=.ext –
“./test/runner.rb” -n test_block_variables ripper/test_parser_events.rb
Run options:

Running tests:

F

Finished tests in 0.040230s, 24.8571 tests/s, 49.7141 assertions/s.

  1. Failure:
    test_block_variables(TestRipper::ParserEvents)
    [/home/yanagi/tmp/ruby/test/ripper/test_parser_events.rb:1099]:
    [ruby-dev:39423].
    <["[fcall(proc,[],&block([],[unary(!,ref(y))]))]"]> expected but was
    <[]>.

1 tests, 2 assertions, 1 failures, 0 errors, 0 skips
make: *** [yes-test-all] Error 1

$ while true; do make test-all TESTS="-n test_block_variables
ripper/test_parser_events.rb"; done 2> /dev/null | grep assertions
Finished tests in 0.040161s, 24.8998 tests/s, 49.7996 assertions/s.
1 tests, 2 assertions, 1 failures, 0 errors, 0 skips
Finished tests in 0.040164s, 24.8979 tests/s, 49.7958 assertions/s.
1 tests, 2 assertions, 1 failures, 0 errors, 0 skips
Finished tests in 0.040066s, 24.9588 tests/s, 49.9176 assertions/s.
1 tests, 2 assertions, 1 failures, 0 errors, 0 skips
Finished tests in 0.037648s, 26.5618 tests/s, 53.1237 assertions/s.
1 tests, 2 assertions, 1 failures, 0 errors, 0 skips
Finished tests in 0.038193s, 26.1828 tests/s, 52.3656 assertions/s.
1 tests, 2 assertions, 1 failures, 0 errors, 0 skips
Finished tests in 0.036932s, 27.0768 tests/s, 81.2304 assertions/s.
1 tests, 3 assertions, 0 failures, 0 errors, 0 skips
Finished tests in 0.036826s, 27.1547 tests/s, 81.4642 assertions/s.
1 tests, 3 assertions, 0 failures, 0 errors, 0 skips
Finished tests in 0.037533s, 26.6432 tests/s, 53.2864 assertions/s.
1 tests, 2 assertions, 1 failures, 0 errors, 0 skips
Finished tests in 0.036618s, 27.3090 tests/s, 81.9269 assertions/s.
1 tests, 3 assertions, 0 failures, 0 errors, 0 skips
(略)

チケット #4159 が更新されました。 (by Motohiro KOSAKI)

エラーメッセージからポイントされている [ruby-dev:39423] は以下のようです

[田中 哲][たなか あきら][Tanaka A.]
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/39423

で前後のメールをみるとそもそも誰も対策してないように見えるのですが、どうでしょう?

チケット #4159 が更新されました。 (by Motohiro KOSAKI)

すいません。誰も対策していないは勘違いだったようです。
以下のようなコミットを発見してしまいました。くすん

commit 72ad8595f2032cfcf73084083306eef909eb42a5
Author: nobu [email protected]
Date: Sat Oct 3 13:14:19 2009 +0000

* parse.y (bv_decls, bvar): fix for block variables.
  [ruby-dev:39423]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/[email protected] 

b2dd03c8-39d4-4d8f-98ff-823fe69b080e

diff --git a/ChangeLog b/ChangeLog
index 07893ce…efc175d 100644
— a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Oct 3 22:14:18 2009 Nobuyoshi N. [email protected]
+

  •   * parse.y (bv_decls, bvar): fix for block variables.
    
  •     [ruby-dev:39423]
    

Sat Oct 3 21:19:18 2009 Nobuyoshi N. [email protected]

    * vm_method.c (rb_add_method_def): no redefinition warning on

diff --git a/parse.y b/parse.y
index 953eaa7…07ee4bc 100644
— a/parse.y
+++ b/parse.y
@@ -3403,7 +3403,7 @@ bv_decls : bvar
/%c%/
/*%c
{

  •                   $$ = rb_ary_new2($1);
    
  •                   $$ = rb_ary_new3(1, $1);
                  }
                  %*/
              | bv_decls ',' bvar
    

@@ -3417,10 +3417,10 @@ bv_decls : bvar

bvar : tIDENTIFIER
{

  •                   new_bv($1);
    
  •                   new_bv(get_id($1));
                  /*%%%*/
                  /*%
    
  •                   $$ = $1;
    
  •                   $$ = get_value($1);
                  %*/
                  }
              | f_bad_arg
    

diff --git a/test/ripper/test_parser_events.rb
b/test/ripper/test_parser_events.rb
index 4a4854b…80199ec 100644
— a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1,6 +1,7 @@
begin

require_relative ‘dummyparser’
+require_relative ‘…/ruby/envutil’
require ‘test/unit’

class TestRipper_ParserEvents < Test::Unit::TestCase
@@ -566,6 +567,15 @@ class TestRipper_ParserEvents <
Test::Unit::TestCase
assert_equal("[fcall(p,[],&block([w],[#{div}]))]", parse(“p{|w|w
/25 # /\n}”), bug1939)
assert_equal("[def(p,[w],bodystmt([#{div}]))]", parse(“def p(w)\nw
/25 # /\nend”), bug1939)
end
+

  • def test_block_variables
  • assert_equal("[fcall(proc,[],&block([],[void()]))]",
    parse(“proc{|;y|}”))
  • if defined?(Process::RLIMIT_AS)
  •  assert_in_out_err(["-I#{File.dirname(__FILE__)}", 
    

“-rdummyparser”],

  •                    'Process.setrlimit(Process::RLIMIT_AS,102400); 
    

puts DummyParser.new(“proc{|;y|}”).parse’,

  •                    ["[fcall(proc,[],&block([],[void()]))]"], [], 
    

‘[ruby-dev:39423]’)

  • end
  • end
    end

rescue LoadError