summaryrefslogtreecommitdiff
path: root/bootstraptest/test_gc.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-16 09:42:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-16 09:42:20 +0000
commit9bcccca47a8a8800a1ac09eeb35dfe5135ca079f (patch)
treeb6d2daa71ba2814356a7cf98d1d0f7e46be8cb11 /bootstraptest/test_gc.rb
parentdd5c77f0c97ed15536302f8b3c0b230d5988682b (diff)
* bootstraptest/test_gc.rb: added tests based on [ruby-dev:39484]
from wanabe <s.wanabe AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_gc.rb')
-rw-r--r--bootstraptest/test_gc.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/bootstraptest/test_gc.rb b/bootstraptest/test_gc.rb
new file mode 100644
index 0000000..eb68c98
--- /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]'