blob: 454c226e1e2797e52eb279bac331d48c15b9991f (
plain)
1
2
3
4
5
6
7
8
9
|
#assert('Kernel.sprintf') do
#end
assert('String#%') do
assert_equal "one=1", "one=%d" % 1
assert_equal "1 one 1.0", "%d %s %3.1f" % [ 1, "one", 1.01 ]
assert_equal "123 < 456", "%{num} < %<str>s" % { num: 123, str: "456" }
assert_equal 16, ("%b" % (1<<15)).size
end
|