Make test/ruby/test_env.rb#test_delete_if_in_ractor easier to debug

This commit is contained in:
Jean Boussier 2025-05-08 09:11:09 +02:00
parent 71baa6943b
commit 49b4e0350d

View file

@ -914,11 +914,11 @@ class TestEnv < Test::Unit::TestCase
h2 = {} h2 = {}
ENV.each_pair {|k, v| h2[k] = v } ENV.each_pair {|k, v| h2[k] = v }
Ractor.yield [h1, h2] Ractor.yield [h1, h2]
Ractor.yield (ENV.delete_if {|k, v| #{ignore_case_str} ? k.upcase == "TEST" : k == "test" }).object_id Ractor.yield (ENV.delete_if {|k, v| #{ignore_case_str} ? k.upcase == "TEST" : k == "test" })
end end
h1, h2 = r.take h1, h2 = r.take
assert_equal(h1, h2) assert_equal(h1, h2)
assert_equal(ENV.object_id, r.take) assert_same(ENV, r.take)
end; end;
end end
@ -968,11 +968,11 @@ class TestEnv < Test::Unit::TestCase
h2 = {} h2 = {}
ENV.each_pair {|k, v| h2[k] = v } ENV.each_pair {|k, v| h2[k] = v }
Ractor.yield [h1, h2] Ractor.yield [h1, h2]
Ractor.yield (ENV.keep_if {|k, v| #{ignore_case_str} ? k.upcase != "TEST" : k != "test" }).object_id Ractor.yield (ENV.keep_if {|k, v| #{ignore_case_str} ? k.upcase != "TEST" : k != "test" })
end end
h1, h2 = r.take h1, h2 = r.take
assert_equal(h1, h2) assert_equal(h1, h2)
assert_equal(ENV.object_id, r.take) assert_equal(ENV, r.take)
end; end;
end end