summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bootstraptest/test_gc.rb34
2 files changed, 39 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a0cab7ec..510c105b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 16 18:42:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bootstraptest/test_gc.rb: added tests based on [ruby-dev:39484]
+ from wanabe <s.wanabe AT gmail.com>.
+
Fri Oct 16 16:09:01 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_spawn): `\'' is also quote character.
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]'