summaryrefslogtreecommitdiff
path: root/test/ruby/test_rational.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_rational.rb')
-rw-r--r--test/ruby/test_rational.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index d65c2929708..834188e4d86 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -646,6 +646,10 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(9, c2.instance_variable_get(:@ivar))
assert_instance_of(Rational, c2)
+ assert_raise(TypeError){
+ Marshal.load("\x04\bU:\rRational[\ai\x060")
+ }
+
assert_raise(ZeroDivisionError){
Marshal.load("\x04\bU:\rRational[\ai\x06i\x05")
}
@@ -664,6 +668,10 @@ class Rational_Test < Test::Unit::TestCase
assert_nothing_raised(bug6625) do
assert_equal(Rational(1, 2), Marshal.load(dump), bug6625)
end
+ dump = "\x04\x08o:\x0dRational\x07:\x11@denominatori\x07:\x0f@numerator0"
+ assert_raise(TypeError) do
+ Marshal.load(dump)
+ end
end
def test_parse