kiyoka.2011_02_04 RSSPLAIN

Related pages: !kiyoka.blog.list !kiyoka.blog.2011_02
55555555555555555555555555555555555555555555555555555555555555555555555
5

[JRuby][Nendo] JRuby 1.6.0-RC1のバグの切りわけができない

5

 

5

久々にブログを書いてみました。

5

Nendoのテストスイートを走らせているのだが、JRuby 1.6.0-RC1のバグっぽい挙動に悩されている。

5

なぜか、次のように失敗する。( CRuby 1.9.2-p136では正常にパスする )

5

expectedとgotの文字列を見ても同じように見えるのだが。

5

 

5

現象

5
ruby -I ./lib /usr/local/bin/rspec -b ./test/nendo_spec.rb
5
.........F.F..................FFFFFFFFFFFFFFFFFFFFFFF
5
5
Failures:
5
5
  1) Nendo when call evalStr() with literals should
5
     Failure/Error: @nendo.evalStr( ' "日本語" ' ).should eql( '"日本語"' )
5
       
5
       expected "\"\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E\""
5
            got "\"\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E\""
5
       
5
       (compared using eql?)
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-expectations-2.4.0/lib/rspec/expectations/fail_with.rb:29:in `fail_with'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-expectations-2.4.0/lib/rspec/expectations/handler.rb:19:in `handle_matcher'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-expectations-2.4.0/lib/rspec/expectations/extensions/kernel.rb:27:in `should'
5
     # ./test/nendo_spec.rb:226:in `(root)'
5
     # org/jruby/RubyBasicObject.java:1682:in `instance_eval19'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example.rb:49:in `run'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example.rb:98:in `with_around_hooks'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example.rb:46:in `run'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example.rb:91:in `with_pending_capture'
5
     # org/jruby/RubyKernel.java:1208:in `rbCatch19'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example.rb:90:in `with_pending_capture'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example.rb:45:in `run'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example_group.rb:261:in `run_examples'
5
     # org/jruby/RubyArray.java:2471:in `collect19'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example_group.rb:257:in `run_examples'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/example_group.rb:231:in `run'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/command_line.rb:27:in `run'
5
     # org/jruby/RubyArray.java:2471:in `collect19'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/command_line.rb:27:in `run'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/reporter.rb:12:in `report'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/command_line.rb:24:in `run'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:55:in `run_in_process'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:46:in `run'
5
     # /usr/local/stow/ruby-1.6.0.RC1-jruby/lib/ruby/gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:10:in `autorun'
5

 

5

UTF-8の文字列の扱いがうまくいかないのかな?

5

Nendoの処理系は instance_eval() を使っているので、次のようなspecファイルでも失敗すると予想したが、失敗しない。

5
 [t_spec.rb]
5
#!/usr/bin/env ruby
5
# -*- encoding: utf-8 -*-
5
#
5
describe Kernel, "when call evalStr() with literals" do
5
  it "should" do
5
    instance_eval( ' "\"abc\"" ' ).should == '"abc"'
5
    instance_eval( ' "\"日本語\"" ' ).should eql '"日本語"'
5
  end
5
end
5

 

5
 実行結果
5
 $ rspec t_spec.rb 
5
.
5
5
Finished in 0.01 seconds
5
1 example, 0 failures
5
 $
5

 

5

そんなわけで、バグ報告したいけど問題を絞り込めないのでちょっと保留かなー。

5

CRubyでは動くので、JRuby側に問題があると思うだけどなー。

5

 

5

...comment disabled...

5