summaryrefslogtreecommitdiff
path: root/test/ruby/test_gc.rb
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-05-12 12:53:14 +0900
committerKoichi Sasada <ko1@atdot.net>2021-05-12 12:53:14 +0900
commit3df7c967bb5fca8767f384374710b1a1529ee37a (patch)
tree62c7727045e7a8d13fe2890cbd32eab722c8c6a0 /test/ruby/test_gc.rb
parent6911b4bc82889860ff7da4ecf975504cdc3e5314 (diff)
suppress warnings on repeat tests.
Constant definitions are affect on outer namespace of an anonymous module. To define constants on the anonymous module, this patch uses Module#class_eval(str).
Diffstat (limited to 'test/ruby/test_gc.rb')
-rw-r--r--test/ruby/test_gc.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index f10946bd39..c3fc1047b6 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -497,8 +497,7 @@ class TestGc < Test::Unit::TestCase
def test_ast_node_buffer
# https://github.com/ruby/ruby/pull/4416
- Module.new.class_eval do
- eval((["# shareable_constant_value: literal"] + (0..100000).map {|i| "M#{ i } = {}" }).join("\n"))
- end
+ Module.new.class_eval( (["# shareable_constant_value: literal"] +
+ (0..100000).map {|i| "M#{ i } = {}" }).join("\n"))
end
end