diff options
author | Kouhei Yanagita <[email protected]> | 2024-11-29 11:10:07 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-12-02 08:28:58 +0900 |
commit | ae59b44041d118514d6ac835e3b34f8a1a72e198 (patch) | |
tree | 213b621b57719aef404c13e43c0454793fac1f70 /test | |
parent | f2334cf4b1fe3b903a17c46004e9dc9127397da7 (diff) |
[ruby/set] Fix ^ to respect subclasses
https://github.com/ruby/set/commit/f88ecdef6b
Diffstat (limited to 'test')
-rw-r--r-- | test/set/test_set.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/set/test_set.rb b/test/set/test_set.rb index 49dc58ef7b..565946096e 100644 --- a/test/set/test_set.rb +++ b/test/set/test_set.rb @@ -643,6 +643,11 @@ class TC_Set < Test::Unit::TestCase ret = set ^ [2,4,5,5] assert_not_same(set, ret) assert_equal(Set[1,3,5], ret) + + set2 = Set2[1,2,3,4] + ret2 = set2 ^ [2,4,5,5] + assert_instance_of(Set2, ret2) + assert_equal(Set2[1,3,5], ret2) end def test_eq |