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

Tests failing with Ruby 3.0 and the sorted_set gem #251

Closed
dleidert opened this issue Nov 28, 2021 · 1 comment
Closed

Tests failing with Ruby 3.0 and the sorted_set gem #251

dleidert opened this issue Nov 28, 2021 · 1 comment

Comments

@dleidert
Copy link

We are in the process of transitioning Debian Linux to Ruby 3.0. In this transition, we discovered that the tests are failing with issues like these:

Failures:

  1) Hamster.to_ruby with Hamster::Hash["a" => 1, "l" => Hamster::SortedSet[1, 2, 3], "h" => /ijk/, "e" => Hamster::Hash["f" => 8, "g" => 9], "d" => Hamster::Set[6, 5, 7], "b" => Hamster::Vector[2, Hamster::Hash["c" => 3], 4]] as input should return {"a"=>1, "b"=>[2, {"c"=>3}, 4], "d"=>#<Set: {5, 6, 7}>, "e"=>{"f"=>8, "g"=>9}, "h"=>/ijk/, "l"=>#<SortedSet: {1, 2, 3}>}
     Failure/Error: expect(Hamster.to_ruby(input)).to eql(expected_result)

       expected: {"a"=>1, "b"=>[2, {"c"=>3}, 4], "d"=>#<Set: {5, 6, 7}>, "e"=>{"f"=>8, "g"=>9}, "h"=>/ijk/, "l"=>#<SortedSet: {1, 2, 3}>}
            got: {"a"=>1, "b"=>[2, {"c"=>3}, 4], "d"=>#<Set: {6, 5, 7}>, "e"=>{"f"=>8, "g"=>9}, "h"=>/ijk/, "l"=>#<SortedSet: {1, 2, 3}>}

       (compared using eql?)

       Diff:
       @@ -1,6 +1,6 @@
        "a" => 1,
        "b" => [2, {"c"=>3}, 4],
       -"d" => #<Set: {5, 6, 7}>,
       +"d" => #<Set: {6, 5, 7}>,
        "e" => {"f"=>8, "g"=>9},
        "h" => /ijk/,
        "l" => #<SortedSet: {1, 2, 3}>,
     # ./spec/lib/hamster/nested/construction_spec.rb:69:in `block (5 levels) in <top (required)>'

  2) Hamster.to_ruby with Hamster::SortedSet[] as input should return #<SortedSet: {}>
     Failure/Error: expect(Hamster.to_ruby(input)).to eql(expected_result)

       expected: #<SortedSet: {}>
            got: #<SortedSet: {}>

       (compared using eql?)
     # ./spec/lib/hamster/nested/construction_spec.rb:69:in `block (5 levels) in <top (required)>'

  3) Hamster.to_ruby with Hamster::SortedSet[1, 2, 3] as input should return #<SortedSet: {1, 2, 3}>
     Failure/Error: expect(Hamster.to_ruby(input)).to eql(expected_result)

       expected: #<SortedSet: {1, 2, 3}>
            got: #<SortedSet: {1, 2, 3}>

       (compared using eql?)
     # ./spec/lib/hamster/nested/construction_spec.rb:69:in `block (5 levels) in <top (required)>'

Finished in 7.25 seconds (files took 0.911 seconds to load)
4595 examples, 3 failures, 1 pending

Failed examples:

rspec './spec/lib/hamster/nested/construction_spec.rb[1:2:1:1]' # Hamster.to_ruby with Hamster::Hash["a" => 1, "l" => Hamster::SortedSet[1, 2, 3], "h" => /ijk/, "e" => Hamster::Hash["f" => 8, "g" => 9], "d" => Hamster::Set[6, 5, 7], "b" => Hamster::Vector[2, Hamster::Hash["c" => 3], 4]] as input should return {"a"=>1, "b"=>[2, {"c"=>3}, 4], "d"=>#<Set: {5, 6, 7}>, "e"=>{"f"=>8, "g"=>9}, "h"=>/ijk/, "l"=>#<SortedSet: {1, 2, 3}>}
rspec './spec/lib/hamster/nested/construction_spec.rb[1:2:8:1]' # Hamster.to_ruby with Hamster::SortedSet[] as input should return #<SortedSet: {}>
rspec './spec/lib/hamster/nested/construction_spec.rb[1:2:9:1]' # Hamster.to_ruby with Hamster::SortedSet[1, 2, 3] as input should return #<SortedSet: {1, 2, 3}>

The cause seems to be this issue: knu/sorted_set#3

@alexdowad
Copy link
Contributor

This has now been fixed on the core branch.

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

No branches or pull requests

2 participants