[ruby/json] Appease ruby/ruby CI

https://github.com/ruby/json/commit/bc2c970ce4
This commit is contained in:
Jean Boussier 2024-11-05 17:30:42 +01:00
parent 633f65e471
commit 4120f2babd
Notes: git 2024-11-05 17:00:56 +00:00

View File

@ -3,7 +3,8 @@ $LOAD_PATH.unshift(File.expand_path('../../../ext', __FILE__), File.expand_path(
require 'json'
require 'test/unit'
if GC.respond_to?(:verify_compaction_references)
if ENV["JSON_COMPACT"]
if GC.respond_to?(:verify_compaction_references)
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
# move objects around, helping to find object movement bugs.
begin
@ -11,14 +12,15 @@ if GC.respond_to?(:verify_compaction_references)
rescue NotImplementedError, ArgumentError
# Some platforms don't support compaction
end
end
end
if GC.respond_to?(:auto_compact=)
if GC.respond_to?(:auto_compact=)
begin
GC.auto_compact = true
rescue NotImplementedError
# Some platforms don't support compaction
end
end
end
unless defined?(Test::Unit::CoreAssertions)