From 54ff3d69966e194460c0a64e76cd4d48ddf1673d Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 25 Jul 2024 13:03:12 -0400 Subject: Fix test_kwarg_eval_memory_leak Hash.new no longer takes keyword arguments except for capacity, so we should just use a method that takes keyword arguments instead. --- test/ruby/test_method.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index a355f86a17..91f4b99181 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -1618,8 +1618,11 @@ class TestMethod < Test::Unit::TestCase def test_kwarg_eval_memory_leak assert_no_memory_leak([], "", <<~RUBY, rss: true, limit: 1.2) + obj = Object.new + def obj.test(**kwargs) = nil + 100_000.times do - eval("Hash.new(foo: 123)") + eval("obj.test(foo: 123)") end RUBY end -- cgit v1.2.3