mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (bit_coerce): float should not be a valid operand of
bitwise operations. [ruby-dev:34583] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
98ad274974
commit
10f263c10e
3 changed files with 17 additions and 8 deletions
|
@ -201,9 +201,9 @@ class TestNumeric < Test::Unit::TestCase
|
|||
|
||||
def test_num2long
|
||||
assert_raise(TypeError) { 1 & nil }
|
||||
assert_equal(1, 1 & 1.0)
|
||||
assert_equal(0, 1 & 2147483648.0)
|
||||
assert_equal(0, 1 & 9223372036854777856.0)
|
||||
assert_raise(TypeError) { 1 & 1.0 }
|
||||
assert_raise(TypeError) { 1 & 2147483648.0 }
|
||||
assert_raise(TypeError) { 1 & 9223372036854777856.0 }
|
||||
o = Object.new
|
||||
def o.to_int; 1; end
|
||||
assert_equal(1, 1 & o)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue