Project

General

Profile

Actions

Bug #12970

closed

== Equality of recursive sets fails

Added by kdeberk (Kevin de Berk) over 7 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.2.5, 2.3.3
[ruby-core:78256]

Description

Comparing recursive arrays and hashes with equal? contents (save for the recursive element) using == succeeds.
However, using == to compare two recursive sets with equal? contents fails. I expect that to succeed.

See the attached script. This is my output for 2.2.5 and 2.3.3:

[1, 2, 3] == [1, 2, 3]? -> true
[1, 2, 3, [...]] == [1, 2, 3, [...]]? -> true
{:a=>1, :b=>2} == {:a=>1, :b=>2}? -> true
{:a=>1, :b=>2, :c=>{...}} == {:a=>1, :b=>2, :c=>{...}}? -> true
#<Set:0x00000001f90fc8> == #<Set:0x00000001f90500>? -> true
#<Set:0x00000001f92968> == #<Set:0x00000001f91478>? -> false

Files

recursive_set_comparison.rb (871 Bytes) recursive_set_comparison.rb kdeberk (Kevin de Berk), 11/22/2016 04:31 PM
fix_recursive_sets.patch (2.39 KB) fix_recursive_sets.patch Esse (Piotr Szmielew), 12/23/2016 09:54 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #6589: Set#rehashClosedknu (Akinori MUSHA)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0