summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-16 10:21:23 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-16 10:21:23 +0000
commitfc035fe32147b8de4b07d80cf61f03995d3269ca (patch)
tree7750c86ba090665963adb024be13d3a32a5488eb /test
parent85b5e64b4a855f7bbe5e43bc54c6dcb30eebc1b9 (diff)
downloadruby-fc035fe32147b8de4b07d80cf61f03995d3269ca.tar.gz
ruby-fc035fe32147b8de4b07d80cf61f03995d3269ca.tar.xz
ruby-fc035fe32147b8de4b07d80cf61f03995d3269ca.zip
* complex.c (nucomp_marshal_{dump,load}): preserve instance
variables. * rational.c (nurat_marshal_{dump,load}): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_complex.rb2
-rw-r--r--test/ruby/test_rational.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index 493e2e2c3..af2311ca0 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -638,10 +638,12 @@ class Complex_Test < Test::Unit::TestCase
def test_marshal
c = Complex(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(Complex, c2)
if defined?(Rational)
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index 1d280e436..de8c31dbc 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -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){