summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_sprintf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-02 04:46:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-02 04:46:41 +0000
commit84bd60efae21f65e4b5aab27563f8e0645d0f540 (patch)
tree39edd93b75f3af6a3c8c5e59bbbd09794105a916 /test/ruby/test_sprintf.rb
parent36ad0b66f52042b4ba3d7015da883e37f239c1c1 (diff)
downloadruby-84bd60efae21f65e4b5aab27563f8e0645d0f540.tar.gz
ruby-84bd60efae21f65e4b5aab27563f8e0645d0f540.tar.xz
ruby-84bd60efae21f65e4b5aab27563f8e0645d0f540.zip
* sprintf.c (rb_f_sprintf): should not check positional number as
width. [ruby-core:11838] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_sprintf.rb')
-rw-r--r--test/ruby/test_sprintf.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb
index 5e0b763e9..018486baa 100644
--- a/test/ruby/test_sprintf.rb
+++ b/test/ruby/test_sprintf.rb
@@ -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))