Skip to content

Test is failed with Ruby 2.5+ #21

Description

@pocke

massign structure has been changed.

$ bundle exec rspec

(snip)

Finished in 0.0096 seconds
47 examples, 11 failures

Failed examples:

rspec ./spec/ruby-hl-lvar_spec.rb:26 # RubyHlLvar::Extractor#extract with simple mass assignment should == [["a", 1, 0], ["b", 1, 3], ["c", 1, 6]]
rspec ./spec/ruby-hl-lvar_spec.rb:32 # RubyHlLvar::Extractor#extract complex mass assignment should == [["a", 1, 0], ["b", 1, 4], ["c", 1, 7]]
rspec ./spec/ruby-hl-lvar_spec.rb:33 # RubyHlLvar::Extractor#extract complex mass assignment should == [["a", 1, 0], ["b", 1, 4]]
rspec ./spec/ruby-hl-lvar_spec.rb:34 # RubyHlLvar::Extractor#extract complex mass assignment should == [["a", 1, 1], ["b", 1, 4]]
rspec ./spec/ruby-hl-lvar_spec.rb:35 # RubyHlLvar::Extractor#extract complex mass assignment should == [["a", 1, 0], ["b", 1, 4], ["c", 1, 7]]
rspec ./spec/ruby-hl-lvar_spec.rb:41 # RubyHlLvar::Extractor#extract lhs of assignment should == [["a", 1, 0], ["a", 2, 1], ["b", 2, 4], ["a", 2, 9]]
rspec ./spec/ruby-hl-lvar_spec.rb:45 # RubyHlLvar::Extractor#extract with complex mass assignment should == [["a", 1, 1], ["b", 1, 5], ["c", 1, 8], ["d", 1, 13]]
rspec ./spec/ruby-hl-lvar_spec.rb:61 # RubyHlLvar::Extractor#extract complex block args should == [["a", 1, 7], ["b", 1, 10], ["c", 1, 12]]
rspec ./spec/ruby-hl-lvar_spec.rb:67 # RubyHlLvar::Extractor#extract array should == [["a", 1, 0], ["b", 1, 2], ["a", 2, 1], ["b", 2, 3]]
rspec ./spec/ruby-hl-lvar_spec.rb:126 # RubyHlLvar::Extractor#extract field mass assignment should == [["z", 1, 5]]
rspec ./spec/ruby-hl-lvar_spec.rb:144 # RubyHlLvar::Extractor#extract for params should == [["x", 1, 5], ["y", 1, 9], ["z", 1, 12]]
$ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.4 ./all-ruby -rpp -rripper -e 'pp Ripper.sexp("a,b=1,2")'
ruby-2.4.0          [:program,
                     [[:massign,
                       [[:@ident, "a", [1, 0]], [:@ident, "b", [1, 2]]],
                       [:mrhs_new_from_args, [[:@int, "1", [1, 4]]], [:@int, "2", [1, 6]]]]]]
...
ruby-2.4.9          [:program,
                     [[:massign,
                       [[:@ident, "a", [1, 0]], [:@ident, "b", [1, 2]]],
                       [:mrhs_new_from_args, [[:@int, "1", [1, 4]]], [:@int, "2", [1, 6]]]]]]
ruby-2.5.0-preview1 [:program,
                     [[:massign,
                       [[:var_field, [:@ident, "a", [1, 0]]],
                        [:var_field, [:@ident, "b", [1, 2]]]],
                       [:mrhs_new_from_args, [[:@int, "1", [1, 4]]], [:@int, "2", [1, 6]]]]]]
...
ruby-2.7.0-preview1 [:program,
                     [[:massign,
                       [[:var_field, [:@ident, "a", [1, 0]]],
                        [:var_field, [:@ident, "b", [1, 2]]]],
                       [:mrhs_new_from_args, [[:@int, "1", [1, 4]]], [:@int, "2", [1, 6]]]]]]

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions