diff options
Diffstat (limited to 'test/objspace')
-rw-r--r-- | test/objspace/test_objspace.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 52558418bf..c05c8c9992 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -275,6 +275,19 @@ class TestObjSpace < Test::Unit::TestCase assert_match /"value":"foobar\h+"/, dump end + def test_dump_all_full + assert_in_out_err(%w[-robjspace], <<-'end;') do |output, error| + def dump_my_heap_please + ObjectSpace.dump_all(output: :stdout, full: true) + end + + dump_my_heap_please + end; + heap = output.find_all { |l| JSON.parse(l)['type'] == "NONE" } + assert_operator heap.length, :>, 0 + end + end + def test_dump_all entry = /"bytesize":11, "value":"TEST STRING", "encoding":"UTF-8", "file":"-", "line":4, "method":"dump_my_heap_please", "generation":/ |