Skip to content

Commit bc2c970

Browse files
committed
Appease ruby/ruby CI
1 parent e851071 commit bc2c970

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
5151
- run: rake compile
5252

53-
- run: rake test
53+
- run: rake test JSON_COMPACT=1
5454

5555
- run: rake build
5656

@@ -78,4 +78,4 @@ jobs:
7878
7979
- run: rake compile
8080

81-
- run: rake valgrind
81+
- run: rake valgrind JSON_COMPACT=1

test/json/test_helper.rb

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
require 'json'
44
require 'test/unit'
55

6-
if GC.respond_to?(:verify_compaction_references)
7-
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
8-
# move objects around, helping to find object movement bugs.
9-
begin
10-
GC.verify_compaction_references(expand_heap: true, toward: :empty)
11-
rescue NotImplementedError, ArgumentError
12-
# Some platforms don't support compaction
6+
if ENV["JSON_COMPACT"]
7+
if GC.respond_to?(:verify_compaction_references)
8+
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
9+
# move objects around, helping to find object movement bugs.
10+
begin
11+
GC.verify_compaction_references(expand_heap: true, toward: :empty)
12+
rescue NotImplementedError, ArgumentError
13+
# Some platforms don't support compaction
14+
end
1315
end
14-
end
1516

16-
if GC.respond_to?(:auto_compact=)
17-
begin
18-
GC.auto_compact = true
19-
rescue NotImplementedError
20-
# Some platforms don't support compaction
17+
if GC.respond_to?(:auto_compact=)
18+
begin
19+
GC.auto_compact = true
20+
rescue NotImplementedError
21+
# Some platforms don't support compaction
22+
end
2123
end
2224
end
2325

0 commit comments

Comments
 (0)