diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_marshal.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 68f50ff728..046c258b85 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -71,4 +71,32 @@ class TestMarshal < Test::Unit::TestCase } assert_equal("marshal data too short", e.message) end + + class DumpTest + def marshal_dump + loop { Thread.pass } + end + end + + class LoadTest + def marshal_dump + nil + end + def marshal_load(obj) + loop { Thread.pass } + end + end + + def test_context_switch + o = DumpTest.new + Thread.new { Marshal.dump(o) } + GC.start + assert(true, '[ruby-dev:39425]') + + o = LoadTest.new + m = Marshal.dump(o) + Thread.new { Marshal.load(m) } + GC.start + assert(true, '[ruby-dev:39425]') + end end |
