From 0603e040b232e019fcf7b6491586f696915819ef Mon Sep 17 00:00:00 2001 From: nahi Date: Sun, 9 May 2004 14:38:11 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ test/ruby/test_float.rb | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6eaa9cff70..d51de34f05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun May 9 23:34:51 2004 NAKAMURA, Hiroshi + + * test/ruby/test_float.rb: added test_strtod to test Float("0"). + Sun May 9 13:24:24 2004 WATANABE Hirofumi * lib/yaml/store.rb: use FileUtils::copy. 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