diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-09 14:38:11 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-09 14:38:11 +0000 |
commit | 0603e040b232e019fcf7b6491586f696915819ef (patch) | |
tree | 0abe254da8d5a51af55cef8f9e2be078c43acbfe /test/ruby/test_float.rb | |
parent | 9c61c44fbae1616d5be762aab7b1ddbe5b0552df (diff) | |
download | ruby-0603e040b232e019fcf7b6491586f696915819ef.tar.gz |
* 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
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r-- | test/ruby/test_float.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |