diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-06 06:48:15 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-06 06:48:15 +0000 |
commit | c1e0cb08f212eb91da1bf915d34435fd2e06fa19 (patch) | |
tree | bf06015348b95b4926c05436258077829ad75b39 /test | |
parent | ed6b1829bad6c30c00b68d5efdf4c2f1af12cc80 (diff) | |
download | ruby-c1e0cb08f212eb91da1bf915d34435fd2e06fa19.tar.gz |
* test_sprintf.rb (test_integer): add some cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_sprintf.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb index 23036d8d0f..ecb4ed1208 100644 --- a/test/ruby/test_sprintf.rb +++ b/test/ruby/test_sprintf.rb @@ -220,6 +220,9 @@ class TestSprintf < Test::Unit::TestCase assert_equal("0B1", sprintf("%#B", 1)) assert_equal("1", sprintf("%d", 1.0)) assert_equal("4294967296", sprintf("%d", (2**32).to_f)) + assert_equal("-2147483648", sprintf("%d", -(2**31).to_f)) + assert_equal("18446744073709551616", sprintf("%d", (2**64).to_f)) + assert_equal("-9223372036854775808", sprintf("%d", -(2**63).to_f)) assert_equal("1", sprintf("%d", "1")) o = Object.new; def o.to_int; 1; end assert_equal("1", sprintf("%d", o)) |