summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_float.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index c3277acfdb..9c4550e38d 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -355,6 +355,9 @@ class TestFloat < Test::Unit::TestCase
assert_operator(i, :>, 0)
end
assert_operator(i.abs, :<=, f.abs)
+ d = f.abs - i.abs
+ assert_operator(0, :<=, d)
+ assert_operator(d, :<, 1)
}
end
@@ -367,6 +370,9 @@ class TestFloat < Test::Unit::TestCase
assert_operator(i, :>, 0)
end
assert_operator(i, :>=, f)
+ d = f - i
+ assert_operator(-1, :<, d)
+ assert_operator(d, :<=, 0)
}
end
@@ -379,6 +385,9 @@ class TestFloat < Test::Unit::TestCase
assert_operator(i, :>, 0)
end
assert_operator(i, :<=, f)
+ d = f - i
+ assert_operator(0, :<=, d)
+ assert_operator(d, :<, 1)
}
end