summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 12:57:23 +0000
committergogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 12:57:23 +0000
commit87e3aec84d13f179fe56a24243baf0f9b55ac87c (patch)
treee55c50b27c11180bf0f3e88d5a50b14914577caa
parentfbc8841a8ff3ec72b640904f2a46166c46e4caec (diff)
downloadruby-87e3aec84d13f179fe56a24243baf0f9b55ac87c.tar.gz
* test/ruby/test_math.rb(test_cbrt): Add an assertion for Math.cbrt(1.0/0)
and move #test_cbrt to more proper place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_math.rb15
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 89c65da9cf..c2ea4b94e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 24 21:45:39 2015 Kazuki Tanaka <mail@tanakakazuki.com>
+
+ * test/ruby/test_math.rb(test_cbrt): Add an assertion for Math.cbrt(1.0/0)
+ and move #test_cbrt to more proper place.
+
Tue Feb 24 19:09:25 2015 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.c (lep_svar_place, lep_svar_get): do not create
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb
index c4d0ff93f2..a6d2df284e 100644
--- a/test/ruby/test_math.rb
+++ b/test/ruby/test_math.rb
@@ -183,6 +183,14 @@ class TestMath < Test::Unit::TestCase
assert_raise(Math::DomainError) { Math.sqrt(-1.0) }
end
+ def test_cbrt
+ check(1, Math.cbrt(1))
+ check(-2, Math.cbrt(-8))
+ check(3, Math.cbrt(27))
+ check(-0.1, Math.cbrt(-0.001))
+ assert_nothing_raised { assert_infinity(Math.cbrt(1.0/0)) }
+ end
+
def test_frexp
check(0.0, Math.frexp(0.0).first)
assert_equal(0, Math.frexp(0).last)
@@ -282,11 +290,4 @@ class TestMath < Test::Unit::TestCase
assert_raise(Math::DomainError) { Math.lgamma(-Float::INFINITY) }
end
-
- def test_cbrt
- check(1, Math.cbrt(1))
- check(-2, Math.cbrt(-8))
- check(3, Math.cbrt(27))
- check(-0.1, Math.cbrt(-0.001))
- end
end