summaryrefslogtreecommitdiff
path: root/test/ruby/test_string_memory.rb
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2024-08-03 00:13:42 +0900
committerYusuke Endoh <[email protected]>2024-08-03 05:25:28 +0900
commit23837c5170180b2e6046961ae09de8688e64a0a2 (patch)
treece9cc6daf928b24feb5432f68c872baa4cd7bf73 /test/ruby/test_string_memory.rb
parent04a6165ac07f8f2107fbbd3a5665944fb27bc092 (diff)
Show where objects were allocated on allocation count tests
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11297
Diffstat (limited to 'test/ruby/test_string_memory.rb')
-rw-r--r--test/ruby/test_string_memory.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_string_memory.rb b/test/ruby/test_string_memory.rb
index 3952d10343..249aa3a269 100644
--- a/test/ruby/test_string_memory.rb
+++ b/test/ruby/test_string_memory.rb
@@ -18,7 +18,14 @@ class TestStringMemory < Test::Unit::TestCase
end
end
- return allocations
+ return allocations.map do |instance|
+ [
+ ObjectSpace.allocation_sourcefile(instance),
+ ObjectSpace.allocation_sourceline(instance),
+ instance.class,
+ instance,
+ ]
+ end
ensure
GC.enable
end