summaryrefslogtreecommitdiff
path: root/test/ruby/test_rational.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-25 08:41:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-25 08:41:07 +0000
commit003c45f9cd570335b7360241724b6967a8ab014a (patch)
treee4bd8551fcfb97f8f2e1b34a1915e14933a8088e /test/ruby/test_rational.rb
parent681c1b9f1b86f2a1198229e40cfa64bbd52e02f9 (diff)
downloadruby-003c45f9cd570335b7360241724b6967a8ab014a.tar.gz
complex.c, rational.c: compatible marshal loader
* complex.c, rational.c: compatible marshal loader for compatibilities with 1.8. [ruby-core:45775] [Bug #6625] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rational.rb')
-rw-r--r--test/ruby/test_rational.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index e1aafb5a0a..cc5ca9a750 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -828,14 +828,15 @@ class Rational_Test < Test::Unit::TestCase
}
bug3656 = '[ruby-core:31622]'
- assert_raise(TypeError, bug3656) {
- Rational(1,2).marshal_load(0)
- }
+ assert_not_respond_to(Rational(1,2), :marshal_load, bug3656)
+ end
- c = Rational(1,2)
- c.freeze
- assert(c.frozen?)
- assert_raise(RuntimeError){c.marshal_load([2,3])}
+ def test_marshal_compatibility
+ bug6625 = '[ruby-core:45775]'
+ dump = "\x04\x08o:\x0dRational\x07:\x11@denominatori\x07:\x0f@numeratori\x06"
+ assert_nothing_raised(bug6625) do
+ assert_equal(Rational(1, 2), Marshal.load(dump), bug6625)
+ end
end
def test_parse