Skip to content

Commit

Permalink
Remove not needed test for ObjectSpace::WeakKeyMap
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed Feb 25, 2025
1 parent e1fd716 commit be9d64f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions spec/truffle/objectspace/weak_key_map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,6 @@
map.getkey(key).should == nil
end

it "has iterators methods that exclude unreferenced objects" do
# This spec does not pass on MRI because the garbage collector is presumably too conservative and will not get rid
# of the references eagerly enough.

map = ObjectSpace::WeakKeyMap.new
k1, k2 = %w[a b].map(&:upcase)
v1, v2 = %w[x y].map(&:upcase)
map[k1] = v1
map[k2] = v2
k2 = nil

Primitive.gc_force

map.key?(k2).should == false
map[k2].should == nil

map.key?(k1).should == true
map[k1].should == v1
end

it "supports frozen objects" do
map = ObjectSpace::WeakKeyMap.new
k = "x".freeze
Expand Down

0 comments on commit be9d64f

Please sign in to comment.