diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-05 14:57:05 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-05 14:57:05 +0000 |
commit | f99bc2c10eb4a911e8382377bbd2fb8b3882e687 (patch) | |
tree | 2e5108924b55b40d8b4bba20ac95bb887125febd /test/ruby/test_marshal.rb | |
parent | 814f534d1180eca991393b0164b54a58ca34b82a (diff) | |
download | ruby-f99bc2c10eb4a911e8382377bbd2fb8b3882e687.tar.gz ruby-f99bc2c10eb4a911e8382377bbd2fb8b3882e687.tar.xz ruby-f99bc2c10eb4a911e8382377bbd2fb8b3882e687.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@16849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r-- | test/ruby/test_marshal.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 2c69367e0..c0e6f996e 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 |