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

* numeric.c (num_rdiv): should always return rational number.

* rational.c (nurat_add, nurat_sub, nurat_mul, nurat_fdiv,
  nurat_cmp): use rb_num_coerce_bin().

* rational.c (nurat_division): does / and rdiv.

* .gdbinit (rp): no longer use rb_p().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-04-02 14:13:53 +00:00
parent f67f196b1d
commit c3d2e4d381
7 changed files with 85 additions and 76 deletions

View file

@ -51,16 +51,7 @@ class TestNumeric < Test::Unit::TestCase
end
def test_quo
DummyNumeric.class_eval do
def /(x); :div; end
end
assert_equal(:div, DummyNumeric.new.quo(0))
ensure
DummyNumeric.class_eval do
remove_method :/
end
assert_raise(ArgumentError) {DummyNumeric.new.quo(0)}
end
def test_divmod