From 42c98194b37bf2c0b0f3f88f8530f46f55a6d55c Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 19 Oct 2017 10:58:08 +0000 Subject: freeze Complex and Rational * complex.c (nucomp_s_new_internal, nucomp_loader): Complex instances are always frozen now. [Feature #13983] * rational.c (nurat_s_new_internal, nurat_loader): Rational instances are always frozen now. [Feature #13983] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_complex.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test/ruby/test_complex.rb') diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index a195e0d4fb..ded316841a 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -75,7 +75,6 @@ class Complex_Test < Test::Unit::TestCase def test_freeze c = Complex(1) - c.freeze assert_predicate(c, :frozen?) assert_instance_of(String, c.to_s) end @@ -534,12 +533,10 @@ 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) c = Complex(Rational(1,2),Rational(2,3)) @@ -551,7 +548,6 @@ class Complex_Test < Test::Unit::TestCase bug3656 = '[ruby-core:31622]' c = Complex(1,2) - c.freeze assert_predicate(c, :frozen?) result = c.marshal_load([2,3]) rescue :fail assert_equal(:fail, result, bug3656) -- cgit v1.2.3