require 'helper' module Syck class TestGC < Test::Unit::TestCase def setup @big_array = 20.times.map do |i| h = {} %w[a b c].each do |k| h[k] = Random.bytes(16).unpack('H*').first end %w[d e f].each do |k| h[k] = Random.rand(0...100_000) end h end GC.stress = true end def teardown GC.stress = false end def test_dump_load_many_hashes yaml = Syck.dump(@big_array) 2.times { Syck.load(yaml) } # If it doesn't segfault, it passed end def test_dump_parse_many_hashes yaml = Syck.dump(@big_array) 2.times { Syck.parse(yaml) } end end end