mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* complex.c (nucomp_marshal_{dump,load}): preserve instance
variables. * rational.c (nurat_marshal_{dump,load}): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
73c8f02384
commit
7c3b57b5d1
5 changed files with 24 additions and 3 deletions
|
@ -854,10 +854,12 @@ class Rational_Test < Test::Unit::TestCase
|
|||
|
||||
def test_marshal
|
||||
c = Rational(1,2)
|
||||
c.instance_eval{@ivar = 9}
|
||||
|
||||
s = Marshal.dump(c)
|
||||
c2 = Marshal.load(s)
|
||||
assert_equal(c, c2)
|
||||
assert_equal(9, c2.instance_variable_get(:@ivar))
|
||||
assert_instance_of(Rational, c2)
|
||||
|
||||
assert_raise(ZeroDivisionError){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue