diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-01 17:46:41 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-01 17:46:41 +0900 |
commit | 57eca0a80dbe5d829108d9a7f46123eb80cd3254 (patch) | |
tree | 9f3c2938736f6ceb0fa62fe3d21a9b0b19457a79 /test/ruby | |
parent | acc76c8c911467fc9496789c52851ba45a9ef5d4 (diff) |
Test for memory leak
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_ast.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 29da607fc5..49c1278340 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1238,6 +1238,15 @@ dummy end end + def test_memory_leak + assert_no_memory_leak([], "#{<<~"begin;"}", "\n#{<<~'end;'}", rss: true) + begin; + 1_000_000.times do + eval("") + end + end; + end + def assert_error_tolerant(src, expected, keep_tokens: false) begin verbose_bak, $VERBOSE = $VERBOSE, false |