1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* complex.c: uses f_real_p macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2008-09-05 22:55:35 +00:00
parent 7d048a55ee
commit 803aafe7c4
4 changed files with 40 additions and 22 deletions

View file

@ -209,6 +209,8 @@ class Rational_Test < Test::Unit::TestCase
assert_raise(ArgumentError){Rational(nil)}
assert_raise(ArgumentError){Rational('')}
assert_raise(ArgumentError){Rational(Object.new)}
assert_raise(ArgumentError){Rational()}
assert_raise(ArgumentError){Rational(1,2,3)}
end
def test_attr
@ -1067,6 +1069,11 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(0.25, Rational(1,2).fdiv(2))
end
def test_ruby19
assert_raise(NoMethodError){ Rational.new(1) }
assert_raise(NoMethodError){ Rational.new!(1) }
end
def test_fixed_bug
if defined?(Rational::Unify)
assert_instance_of(Fixnum, Rational(1,2) ** 0) # mathn's bug