From 0603e040b232e019fcf7b6491586f696915819ef Mon Sep 17 00:00:00 2001 From: nahi Date: Sun, 9 May 2004 14:38:11 +0000 Subject: * test/ruby/test_float.rb: added test_strtod to test Float("0"). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_float.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 568c56181a..6fae9bf493 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -51,4 +51,16 @@ class TestFloat < Test::Unit::TestCase b = 100000000000000000000000.0 assert_equal(a == b, b == a) end + + def test_strtod + a = Float("0") + assert(a.abs < Float::EPSILON) + a = Float("0.0") + assert(a.abs < Float::EPSILON) + a = Float("+0.0") + assert(a.abs < Float::EPSILON) + a = Float("-0.0") + assert(a.abs < Float::EPSILON) + # add expected behaviour here. + end end -- cgit v1.2.3