mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
ed6b1829ba
commit
c1e0cb08f2
1 changed files with 3 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue