Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method name encoding seems off #2127

Closed
headius opened this issue Nov 6, 2014 · 6 comments
Closed

Method name encoding seems off #2127

headius opened this issue Nov 6, 2014 · 6 comments

Comments

@headius
Copy link
Member

headius commented Nov 6, 2014

This case from mri/ruby/test_syntax:

  def test_error_message_encoding
    bug10114 = '[ruby-core:64228] [Bug #10114]'
    code = "# -*- coding: utf-8 -*-\n" "def n \"\u{2208}\"; end"
    assert_syntax_error(code, /def n "\u{2208}"; end/, bug10114)
  end

fails with:

TestSyntax#test_error_message_encoding [/Users/headius/projects/jruby/test/mri/ruby/test_syntax.rb:473]:
[ruby-core:64228] [Bug #10114].
Expected /def n "\u{2208}"; end/ to match "[ruby-core:64228] [Bug #10114]:2: syntax error, unexpected tSTRING_BEG\ndef n \"â\u0088\u0088\"; end\n      ^".

Unsure where the fix is needed but I'll mark parser and core.

@headius headius added this to the JRuby 9000 milestone Nov 6, 2014
@enebo enebo modified the milestone: JRuby 9.0.0.0 Jul 14, 2015
@jodosha
Copy link

jodosha commented Oct 16, 2015

Hello @headius and @enebo I've found an error with encoding method name, but not sure if it's related to this. See hanami/utils@e384900

For this reason I reported the problem here, instead of opening a new issue. Cheers :)

@enebo
Copy link
Member

enebo commented Apr 1, 2016

@jodosha this is not related but if you could try out nightlies I think your original source should work now (on Jruby 9000): http://ci.jruby.org/. Let me know if not..

@enebo enebo added this to the JRuby 9.1.0.0 milestone Apr 1, 2016
@enebo enebo closed this as completed in 2d88cd8 Apr 1, 2016
@jodosha
Copy link

jodosha commented Apr 1, 2016

@enebo The problem is still there:

➜ ruby -v
jruby 9.1.0.0-SNAPSHOT (2.3.0) 2016-04-01 30c1276 Java HotSpot(TM) 64-Bit Server VM 25.60-b23 on 1.8.0_60-b27 +jit [darwin-x86_64]

(master) ~/Code/hanami/utils:jruby-9.1.0.0-SNAPSHOT ➜ g revert --no-commit e38490099113c4e6e1ad5878050ca826f7fabe3c
*(master) ~/Code/hanami/utils:jruby-9.1.0.0-SNAPSHOT ➜ bundle exec rake
NameError: Undefined method test_0001_escapes 'тест' for class '#<Class:0x10027fc9>'
                                                                         undef_method at org/jruby/RubyModule.java:2710
                                                                          block in it at /Users/luca/.gem/jruby/2.3.0/gems/minitest-5.8.4/lib/minitest/spec.rb:225
                                                                                 each at org/jruby/RubyArray.java:1593
                                                                                   it at /Users/luca/.gem/jruby/2.3.0/gems/minitest-5.8.4/lib/minitest/spec.rb:224
                                                                      block in (root) at /Users/luca/Code/hanami/utils/test/escape_test.rb:105
                                                                          module_eval at org/jruby/RubyModule.java:2719
                                                                             describe at /Users/luca/.gem/jruby/2.3.0/gems/minitest-5.8.4/lib/minitest/spec.rb:83
                                                                      block in (root) at /Users/luca/Code/hanami/utils/test/escape_test.rb:8
                                                                          module_eval at org/jruby/RubyModule.java:2719
                                                                             describe at /Users/luca/.gem/jruby/2.3.0/gems/minitest-5.8.4/lib/minitest/spec.rb:83
                                                                                <top> at /Users/luca/Code/hanami/utils/test/escape_test.rb:5
                                                                              require at org/jruby/RubyKernel.java:944
  block in /Users/luca/.gem/jruby/2.3.0/gems/rake-11.1.1/lib/rake/rake_test_loader.rb at /Users/luca/.gem/jruby/2.3.0/gems/rake-11.1.1/lib/rake/rake_test_loader.rb:10
                                                                                 each at org/jruby/RubyArray.java:1593
  block in /Users/luca/.gem/jruby/2.3.0/gems/rake-11.1.1/lib/rake/rake_test_loader.rb at /Users/luca/.gem/jruby/2.3.0/gems/rake-11.1.1/lib/rake/rake_test_loader.rb:9
                                                                               select at org/jruby/RubyArray.java:2411
                                                                                <top> at /Users/luca/.gem/jruby/2.3.0/gems/rake-11.1.1/lib/rake/rake_test_loader.rb:4
rake aborted!
Command failed with status (1): [ruby -w -I"lib:test" -I"/Users/luca/.gem/jruby/2.3.0/gems/rake-11.1.1/lib" "/Users/luca/.gem/jruby/2.3.0/gems/rake-11.1.1/lib/rake/rake_test_loader.rb" "test/**/*_test.rb" ]

Tasks: TOP => default => test
(See full trace by running task with --trace)

@enebo
Copy link
Member

enebo commented Apr 2, 2016

@jodosha can you open up a new issue for this? It will be a little gory to untangle since it appears rspec will make a method and then once it is finished it tries to undef it (does not know how rspec is implemented)? It looks like it executes but then when it is time to remove it we are passing a different set of bytes/String to find the method definition. At least it is a guess.

@jodosha
Copy link

jodosha commented Apr 4, 2016

@enebo Sure, there it is: #3778

@enebo
Copy link
Member

enebo commented Apr 4, 2016

@jodosha yeah look's perfect! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants