diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-01 06:44:30 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-01 06:44:30 +0000 |
commit | 9b40cdfe8c973a061c5683ad78c283b9ddb8b2e9 (patch) | |
tree | bd1a53f7d981da9aa44eebe6a6dc395407a7443c /test/ruby/test_sprintf.rb | |
parent | 7e3e79d0833953f8243e304a86a96b7e41a310a6 (diff) |
Add test for sprintf with Infinity and NaN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_sprintf.rb')
-rw-r--r-- | test/ruby/test_sprintf.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb index f8dbbd511e..5f39719446 100644 --- a/test/ruby/test_sprintf.rb +++ b/test/ruby/test_sprintf.rb @@ -202,6 +202,10 @@ class TestSprintf < Test::Unit::TestCase assert_equal("0x1p+10", sprintf("%a", 1024)) assert_equal("0x1.23456p+789", sprintf("%a", 3.704450999893983e+237)) assert_equal("0x1p-1074", sprintf("%a", 4.9e-324)) + assert_equal("Inf", sprintf("%e", Float::INFINITY)) + assert_equal("Inf", sprintf("%E", Float::INFINITY)) + assert_equal("NaN", sprintf("%e", Float::NAN)) + assert_equal("NaN", sprintf("%E", Float::NAN)) end BSIZ = 120 |