summaryrefslogtreecommitdiff
path: root/test/ruby/test_weakmap.rb
AgeCommit message (Collapse)Author
2019-08-29Allow non-finalizable objects in ObjectSpace::WeakMapJean Boussier
[feature #16035] This goes one step farther than what nobu did in [feature #13498] With this patch, special objects such as static symbols, integers, etc can be used as either key or values inside WeakMap. They simply don't have a finalizer defined on them. This is useful if you need to deduplicate value objects Notes: Merged: https://github.com/ruby/ruby/pull/2313
2019-06-23Frozen objects in WeakMapNobuyoshi Nakada
* gc.c (wmap_aset): bypass check for frozen and allow frozen object in WeakMap. [Bug #13498]
2018-03-16test_weakmap.rb: skip unstable assertionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14test_weakmap.rb: fixing CI failuresnobu
* test/ruby/test_weakmap.rb (test_include?): create and release the object to be garbage-collected in deeper frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13Rename test classes to allow stable test count when running test-all -jnobu
[Fix GH-1763] From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27skip tests temporarilyko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-11* include/ruby/ruby.h: freeze nil/true/false.ko1
* gc.c (should_be_finalizable): check frozen after checkin FL_ABLE. * object.c (rb_obj_taint): check OBJ_TAINTABLE(obj). * object.c (rb_obj_freeze): remove immediate_frozen_tbl because all of immediate values are frozen. YAY! * object.c (rb_obj_frozen_p): ditto. * test/ruby/test_eval.rb: skip instance_variable_set for frozen objects. * test/ruby/test_weakmap.rb: check ArgumentError instead of RuntimeError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test_weakmap.rb: fix testnobu
* test/ruby/test_weakmap.rb (test_include?): create target object in a block, so that collected soon as possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test_weakmap.rb: fix testnobu
* test/ruby/test_weakmap.rb (test_include?): Object.new does not excute the block, use tap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test_weakmap.rb: fix testnobu
* test/ruby/test_weakmap.rb (test_include?): isolate weak referenced object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10gc.c: check arguments firstnobu
* gc.c (wmap_aset): check if both arguments are able to finalize before setting finalizers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10gc.c: fix WeakMap#inspectnobu
* gc.c (wmap_inspect_i): fix key/value order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09gc.c: ObjectSpace::WeakMap#sizenobu
* gc.c (wmap_size): add ObjectSpace::WeakMap#size and #length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09test_weakmap.rb: addnobu
* test/ruby/test_weakmap.rb: test for ObjectSpace::WeakMap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e