Project

General

Profile

Bug #18470 ยป set_test.rb

smokinggun (John Weir), 01/10/2022 08:22 PM

 
require 'test/unit'
require 'set'

class TestSet < Test::Unit::TestCase
C = Struct.new :id

def test_set_comparison
a = Set.new
b = Set.new
f = C.new
a << f
f.id = 1
b << f

assert_equal a.first, b.first
assert_equal b.first, a.first
assert_equal a, (b + a)
# fails
assert_equal a, (a + b)
end
end
    (1-1/1)