diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-21 02:17:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-21 02:17:29 +0000 |
commit | b2270a36e7d42043b8640355fbd7901f852920fe (patch) | |
tree | 7f17514beb7d5782b39505d958e198a3b08db8e5 /test/ruby | |
parent | 2a546caae63960a269cb58731e61fea4c7e9797c (diff) | |
download | ruby-b2270a36e7d42043b8640355fbd7901f852920fe.tar.gz |
numeric.c: refine error message
* numeric.c (rb_num_get_rounding_option): refine error message at
invalid rounding mode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_float.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index f2989e4f5b..74744bfaa2 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -701,6 +701,12 @@ class TestFloat < Test::Unit::TestCase assert_equal(-7.1364, -7.1364499.round(4, half: :up)) end + def test_round_half_invalid + assert_raise_with_message(ArgumentError, /xxx/) { + 1.0.round(half: "\0xxx") + } + end + def test_Float assert_in_delta(0.125, Float("0.1_2_5"), 0.00001) assert_in_delta(0.125, "0.1_2_5__".to_f, 0.00001) |