From 7002e776944ddfd362cea253d18d02bc250fe9f7 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sun, 24 Dec 2023 19:22:13 -0500 Subject: Fix Symbol#inspect for GC compaction The test fails when RGENGC_CHECK_MODE is turned on: 1) Failure: TestSymbol#test_inspect_under_gc_compact_stress [test/ruby/test_symbol.rb:123]: <":testing"> expected but was <":\x00\x00\x00\x00\x00\x00\x00">. --- test/ruby/test_symbol.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 1d2a18d734..7f75ecd90e 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -118,6 +118,12 @@ class TestSymbol < Test::Unit::TestCase end end + def test_inspect_under_gc_compact_stress + EnvUtil.under_gc_compact_stress do + assert_inspect_evaled(':testing') + end + end + def test_name assert_equal("foo", :foo.name) assert_same(:foo.name, :foo.name) -- cgit v1.2.3