diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-20 12:37:13 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-20 12:37:13 +0000 |
commit | d82ed7e2c6e0f873ccacafb28c36a293383c3c15 (patch) | |
tree | c93e5695bc4a74d61a2aecca86190ccefdb8ac0b /test/ruby/test_numeric.rb | |
parent | a05fd849a148f129e5797b8261cd7e14f871e650 (diff) | |
download | ruby-d82ed7e2c6e0f873ccacafb28c36a293383c3c15.tar.gz |
* numeric.c (num_div): don't use num_floor which is actually
flo_floor.
* numeric.c (num_modulo): don't call '%'.
* numeric.c (num_divmod): use num_modulo.
* numeric.c: defined '%'.
* rational.c (nurat_idiv,nurat_mod,nurat_divmod,nurat_rem): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_numeric.rb')
-rw-r--r-- | test/ruby/test_numeric.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index 0dd7b2e99c..43d53e7fcf 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -55,6 +55,7 @@ class TestNumeric < Test::Unit::TestCase end def test_divmod +=begin DummyNumeric.class_eval do def /(x); 42.0; end def %(x); :mod; end @@ -63,13 +64,16 @@ class TestNumeric < Test::Unit::TestCase assert_equal(42, DummyNumeric.new.div(1)) assert_equal(:mod, DummyNumeric.new.modulo(1)) assert_equal([42, :mod], DummyNumeric.new.divmod(1)) +=end assert_kind_of(Integer, 11.divmod(3.5).first, '[ruby-dev:34006]') +=begin ensure DummyNumeric.class_eval do remove_method :/, :% end +=end end def test_real_p |