From 0dc342de848a642ecce8db697b8fecd83a63e117 Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 25 Aug 2008 15:02:05 +0000 Subject: added tag v1_9_0_4 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- trunk/bootstraptest/test_objectspace.rb | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 trunk/bootstraptest/test_objectspace.rb (limited to 'trunk/bootstraptest/test_objectspace.rb') diff --git a/trunk/bootstraptest/test_objectspace.rb b/trunk/bootstraptest/test_objectspace.rb new file mode 100644 index 0000000000..1a43d42017 --- /dev/null +++ b/trunk/bootstraptest/test_objectspace.rb @@ -0,0 +1,33 @@ +assert_normal_exit %q{ + eval("", TOPLEVEL_BINDING) + minobj = ObjectSpace.to_enum(:each_object).min_by {|a| a.object_id } + maxobj = ObjectSpace.to_enum(:each_object).max_by {|a| a.object_id } + minobj.object_id.upto(maxobj.object_id) {|id| + begin + o = ObjectSpace._id2ref(id) + rescue RangeError + next + end + o.inspect if defined?(o.inspect) + } +}, '[ruby-dev:31911]' + +assert_normal_exit %q{ + ary = (1..10).to_a + ary.permutation(2) {|x| + if x == [1,2] + ObjectSpace.each_object(String) {|s| + s.clear if !s.frozen? && (s.length == 40 || s.length == 80) + } + end + } +}, '[ruby-dev:31982]' + +assert_normal_exit %q{ + ary = (1..100).to_a + ary.permutation(2) {|x| + if x == [1,2] + ObjectSpace.each_object(Array) {|o| o.clear if o == ary && o.object_id != ary.object_id } + end + } +}, '[ruby-dev:31985]' -- cgit v1.2.3