Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Commit

Permalink
Add test for #150
Browse files Browse the repository at this point in the history
Test that Ruby objects created in C do not get garbage collected.
  • Loading branch information
stevecheckoway committed Nov 21, 2020
1 parent 9b5a886 commit 55d7b96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Deprecated
### Removed
### Fixed
- Fixed crash where Ruby objects constructed in C can be garbage collected.
### Security

## [2.0.2] - 2019-11-19
Expand Down
7 changes: 7 additions & 0 deletions test/test_nokogumbo.rb
@@ -1,5 +1,12 @@
# encoding: utf-8
require 'nokogumbo'

# Make sure that Ruby objects constructed in C are treated as GC roots.
# See: https://github.com/rubys/nokogumbo/pull/150
if GC.respond_to?(:verify_compaction_references)
GC.verify_compaction_references(toward: :empty, double_heap: true)
end

require 'minitest/autorun'

class TestNokogumbo < Minitest::Test
Expand Down

0 comments on commit 55d7b96

Please sign in to comment.