mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/test_{string,sprintf}.rb: updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
79f1b9e93b
commit
840723e523
2 changed files with 5 additions and 5 deletions
|
@ -31,22 +31,22 @@ class TestSprintf < Test::Unit::TestCase
|
|||
assert_equal(" 0010", sprintf("%6.4b", 2))
|
||||
assert_equal(" ..11", sprintf("%6.4b", -1))
|
||||
|
||||
assert_equal(" 0b0", sprintf("%#4b", 0))
|
||||
assert_equal(" 0", sprintf("%#4b", 0))
|
||||
assert_equal(" 0b1", sprintf("%#4b", 1))
|
||||
assert_equal("0b10", sprintf("%#4b", 2))
|
||||
assert_equal("0b..1", sprintf("%#4b", -1))
|
||||
|
||||
assert_equal("0b00", sprintf("%#04b", 0))
|
||||
assert_equal("0000", sprintf("%#04b", 0))
|
||||
assert_equal("0b01", sprintf("%#04b", 1))
|
||||
assert_equal("0b10", sprintf("%#04b", 2))
|
||||
assert_equal("0b..1", sprintf("%#04b", -1))
|
||||
|
||||
assert_equal("0b0000", sprintf("%#.4b", 0))
|
||||
assert_equal("0000", sprintf("%#.4b", 0))
|
||||
assert_equal("0b0001", sprintf("%#.4b", 1))
|
||||
assert_equal("0b0010", sprintf("%#.4b", 2))
|
||||
assert_equal("0b..11", sprintf("%#.4b", -1))
|
||||
|
||||
assert_equal("0b0000", sprintf("%#6.4b", 0))
|
||||
assert_equal(" 0000", sprintf("%#6.4b", 0))
|
||||
assert_equal("0b0001", sprintf("%#6.4b", 1))
|
||||
assert_equal("0b0010", sprintf("%#6.4b", 2))
|
||||
assert_equal("0b..11", sprintf("%#6.4b", -1))
|
||||
|
|
|
@ -207,7 +207,7 @@ class TestString < Test::Unit::TestCase
|
|||
171,
|
||||
171]
|
||||
|
||||
assert_equal(S(' hi 123 %foo 456 0x0A3.1 1011 ab AB 0b1011 0xab 0XAB'), x)
|
||||
assert_equal(S(' hi 123 %foo 456 0A3.1 1011 ab AB 0b1011 0xab 0XAB'), x)
|
||||
end
|
||||
|
||||
def test_MUL # '*'
|
||||
|
|
Loading…
Reference in a new issue