diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_complex.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 2 |
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){ |