From 505e1e5f8b446268f1c5d440a0cea50f99a27dde Mon Sep 17 00:00:00 2001 From: gogotanaka Date: Sat, 31 Jan 2015 16:09:03 -0800 Subject: [PATCH 1/2] Reorder TestMath#test_cbrt and add a assertion To: https://bugs.ruby-lang.org/ --- test/ruby/test_math.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb index c4d0ff9..a067aae 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_equal(1.0/0, 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 -- gogotanaka