* test/ruby/test_numeric.rb (TestNumeric::test_num2long): bit-and

should not raise RangeError.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-03-13 16:38:56 +00:00
parent 1d2078824f
commit 020d4e4d38
2 changed files with 5 additions and 4 deletions

View File

@ -17,6 +17,9 @@ Thu Mar 13 10:42:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (zip_ary): wrong boundary condition.
* test/ruby/test_numeric.rb (TestNumeric::test_num2long): bit-and
should not raise RangeError.
Thu Mar 13 03:12:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb/cmd/help.rb: should be updated for new ri structure.

View File

@ -211,10 +211,8 @@ class TestNumeric < Test::Unit::TestCase
def test_num2long
assert_raise(TypeError) { 1 & nil }
assert_equal(1, 1 & 1.0)
assert_raise(RangeError) do
1 & 2147483648.0
1 & 9223372036854777856.0
end
assert_equal(0, 1 & 2147483648.0)
assert_equal(0, 1 & 9223372036854777856.0)
o = Object.new
def o.to_int; 1; end
assert_equal(1, 1 & o)