diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-27 16:12:15 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-27 16:12:15 +0900 |
commit | 1ddc719a562b1ee4c3ae6cf4d1f6c386e142b087 (patch) | |
tree | 557b2d25cf1a1787b155b25ebd6884ecaaa57ed4 /test/ruby/test_float.rb | |
parent | af899503a646f20d63d4aa2f358894b98f85dab7 (diff) | |
download | ruby-1ddc719a562b1ee4c3ae6cf4d1f6c386e142b087.tar.gz |
Check the encoding of `half:` option
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r-- | test/ruby/test_float.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 7cbf3b5a8f..a94bbce49e 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -764,6 +764,9 @@ class TestFloat < Test::Unit::TestCase assert_raise_with_message(ArgumentError, /xxx/) { 1.0.round(half: "\0xxx") } + assert_raise_with_message(Encoding::CompatibilityError, /ASCII incompatible/) { + 1.0.round(half: "up".force_encoding("utf-16be")) + } end def test_Float |