diff options
Diffstat (limited to 'test/ruby/test_complex.rb')
-rw-r--r-- | test/ruby/test_complex.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index aa6d6a77fe..adf4a01b2d 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -658,14 +658,15 @@ class Complex_Test < Test::Unit::TestCase end bug3656 = '[ruby-core:31622]' - assert_raise(TypeError, bug3656) { - Complex(1,2).marshal_load(0) - } + assert_not_respond_to(Complex(1,2), :marshal_load, bug3656) + end - c = Complex(1,2) - c.freeze - assert(c.frozen?) - assert_raise(RuntimeError){c.marshal_load([2,3])} + def test_marshal_compatibility + bug6625 = '[ruby-core:45775]' + dump = "\x04\x08o:\x0cComplex\x07:\x0a@reali\x06:\x0b@imagei\x07" + assert_nothing_raised(bug6625) do + assert_equal(Complex(1, 2), Marshal.load(dump), bug6625) + end end def test_parse |