From 815ab02971f7b94e276823f407b8fc2723bf703b Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 23 Aug 2010 03:19:58 +0000 Subject: * util.c (ruby_strtod): make sure to have digit-sequence after 'p' for hexadecimal-floating-constant. [ruby-dev:42105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_float.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/ruby/test_float.rb') diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index a8ce76edbc..e534ab294f 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -446,6 +446,8 @@ class TestFloat < Test::Unit::TestCase assert_equal(1, suppress_warning {Float(([1] * 10000).join)}.infinite?) assert(!Float(([1] * 10000).join("_")).infinite?) # is it really OK? assert_raise(ArgumentError) { Float("1.0\x001") } + assert_equal(15.9375, Float('0xf.fp0')) + assert_raise(ArgumentError) { Float('0xf.fp') } assert_equal(1, suppress_warning {Float("1e10_00")}.infinite?) assert_raise(TypeError) { Float(nil) } o = Object.new -- cgit v1.2.3