mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* sprintf.c (rb_f_sprintf): should not check positional number as
width. [ruby-core:11838] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
12b1e59f2e
commit
46e848a65a
4 changed files with 13 additions and 4 deletions
|
@ -1,6 +1,10 @@
|
|||
require 'test/unit'
|
||||
|
||||
class TestSprintf < Test::Unit::TestCase
|
||||
def test_positional
|
||||
assert_equal(" 00001", sprintf("%*1$.*2$3$d", 10, 5, 1))
|
||||
end
|
||||
|
||||
def test_binary
|
||||
assert_equal("0", sprintf("%b", 0))
|
||||
assert_equal("1", sprintf("%b", 1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue