[前][次][番号順一覧][スレッド一覧]

ruby-changes:24491

From: nobu <ko1@a...>
Date: Thu, 26 Jul 2012 12:08:53 +0900 (JST)
Subject: [ruby-changes:24491] nobu:r36542 (trunk): test_complex.rb, test_rational.rb: revert some assertions

nobu	2012-07-26 12:08:41 +0900 (Thu, 26 Jul 2012)

  New Revision: 36542

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36542

  Log:
    test_complex.rb, test_rational.rb: revert some assertions
    
    * test_complex.rb, test_rational.rb: revert some assertions, but just
      assert that a frozen object cannot be modified with marshal_load.

  Modified files:
    trunk/test/ruby/test_complex.rb
    trunk/test/ruby/test_rational.rb

Index: test/ruby/test_complex.rb
===================================================================
--- test/ruby/test_complex.rb	(revision 36541)
+++ test/ruby/test_complex.rb	(revision 36542)
@@ -658,7 +658,12 @@
     end
 
     bug3656 = '[ruby-core:31622]'
-    assert_not_respond_to(Complex(1,2), :marshal_load, bug3656)
+    c = Complex(1,2)
+    c.freeze
+    assert(c.frozen?)
+    result = c.marshal_load([2,3]) rescue :fail
+    assert_equal(:fail, result, bug3656)
+    assert_equal(Complex(1,2), c)
   end
 
   def test_marshal_compatibility
Index: test/ruby/test_rational.rb
===================================================================
--- test/ruby/test_rational.rb	(revision 36541)
+++ test/ruby/test_rational.rb	(revision 36542)
@@ -828,7 +828,11 @@
     }
 
     bug3656 = '[ruby-core:31622]'
-    assert_not_respond_to(Rational(1,2), :marshal_load, bug3656)
+    c = Rational(1,2)
+    c.freeze
+    assert(c.frozen?)
+    result = c.marshal_load([2,3]) rescue :fail
+    assert_equal(:fail, result, bug3656)
   end
 
   def test_marshal_compatibility

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]