1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add invalid hexadecimal float tests

This commit is contained in:
Nobuyoshi Nakada 2021-07-01 06:38:33 +09:00
parent 560941e711
commit 0cc989696e
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -141,6 +141,9 @@ class TestFloat < Test::Unit::TestCase
assert_raise(ArgumentError){Float("1__1")}
assert_raise(ArgumentError){Float("1.")}
assert_raise(ArgumentError){Float("1.e+00")}
assert_raise(ArgumentError){Float("0x.1")}
assert_raise(ArgumentError){Float("0x1.")}
assert_raise(ArgumentError){Float("0x1.0")}
assert_raise(ArgumentError){Float("0x1.p+0")}
# add expected behaviour here.
assert_equal(10, Float("1_0"))