diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-16 09:42:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-16 09:42:20 +0000 |
commit | b320370f8f67309b0259e72f10b1cc5ed82d4213 (patch) | |
tree | b6d2daa71ba2814356a7cf98d1d0f7e46be8cb11 /bootstraptest | |
parent | da06476f8b4775bcafc6dea87b13579f711e0eaf (diff) | |
download | ruby-b320370f8f67309b0259e72f10b1cc5ed82d4213.tar.gz ruby-b320370f8f67309b0259e72f10b1cc5ed82d4213.tar.xz ruby-b320370f8f67309b0259e72f10b1cc5ed82d4213.zip |
* bootstraptest/test_gc.rb: added tests based on [ruby-dev:39484]
from wanabe <s.wanabe AT gmail.com>.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_gc.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bootstraptest/test_gc.rb b/bootstraptest/test_gc.rb new file mode 100644 index 000000000..eb68c9845 --- /dev/null +++ b/bootstraptest/test_gc.rb @@ -0,0 +1,34 @@ +assert_normal_exit %q{ +a = [] +ms = "a".."k" +("A".."Z").each do |mod| + mod = eval("module #{mod}; self; end") + ms.each do |meth| + iseq = RubyVM::InstructionSequence.compile("module #{mod}; def #{meth}; end; end") + GC.stress = true + iseq.eval + GC.stress = false + end + o = Object.new.extend(mod) + ms.each do |meth| + o.send(meth) + end +end +}, '[ruby-dev:39453]' + +assert_normal_exit %q{ +a = [] +ms = "a".."k" +("A".."Z").each do |mod| + mod = eval("module #{mod}; self; end") + ms.each do |meth| + GC.stress = true + mod.module_eval {define_method(meth) {}} + GC.stress = false + end + o = Object.new.extend(mod) + ms.each do |meth| + o.send(meth) + end +end +}, '[ruby-dev:39453]' |