From 00aae60f73bd800d2789501a732cb6ab7c44e528 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 5 Jun 2008 14:57:05 +0000 Subject: * test/ruby/test_gc.rb: add tests to achieve over 90% test coverage of gc.c. * test/ruby/test_objectspace.rb: ditto. * test/ruby/test_marshal.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_marshal.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/ruby/test_marshal.rb') diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 2c69367e05..c0e6f996e9 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -152,4 +152,20 @@ class TestMarshal < Test::Unit::TestCase eval("C3 = Struct.new(:foo, :baz)") assert_raise(TypeError) { Marshal.load(m) } end + + class C4 + def initialize(gc) + @gc = gc + end + def _dump(s) + GC.start if @gc + "foo" + end + end + + def test_gc + assert_nothing_raised do + Marshal.dump((0..1000).map {|x| C4.new(x % 50 == 25) }) + end + end end -- cgit v1.2.3