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 | 5afd2766f9cdf56df25bc95d98a28233153a4e05 (patch) | |
| tree | bf06015348b95b4926c05436258077829ad75b39 /test/ruby | |
| parent | 312de647e72b9bbfb7ef744aaf44b775bd236606 (diff) | |
| download | ruby-5afd2766f9cdf56df25bc95d98a28233153a4e05.tar.gz ruby-5afd2766f9cdf56df25bc95d98a28233153a4e05.tar.xz ruby-5afd2766f9cdf56df25bc95d98a28233153a4e05.zip | |
* test_sprintf.rb (test_integer): add some cases.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -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 23036d8d0..ecb4ed120 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)) |
