summaryrefslogtreecommitdiff
path: root/test/-ext-/num2int
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-/num2int')
-rw-r--r--test/-ext-/num2int/test_num2int.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/-ext-/num2int/test_num2int.rb b/test/-ext-/num2int/test_num2int.rb
index 90827fdc1f..47e57fffc6 100644
--- a/test/-ext-/num2int/test_num2int.rb
+++ b/test/-ext-/num2int/test_num2int.rb
@@ -36,6 +36,11 @@ class TestNum2int < Test::Unit::TestCase
assert_output(result.to_s) do
Num2int.send(method, num)
end
+ if num.to_f.to_i == num
+ assert_output(result.to_s) do
+ Num2int.send(method, num.to_f)
+ end
+ end
end
def asert_num2i_error(type, num)
@@ -43,6 +48,11 @@ class TestNum2int < Test::Unit::TestCase
assert_raise(RangeError) do
Num2int.send(method, num)
end
+ if num.to_f.to_i == num
+ assert_raise(RangeError) do
+ Num2int.send(method, num)
+ end
+ end
end
def test_num2short