1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* sprintf.c: add short documentation about named reference.

[ruby-core:31294]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-07-21 06:16:07 +00:00
parent 3f606b9aca
commit 6e2850aa46
3 changed files with 17 additions and 0 deletions

View file

@ -294,5 +294,8 @@ class TestSprintf < Test::Unit::TestCase
assert_equal("value", sprintf("%<key>s", :key => "value"))
assert_raise(ArgumentError) {sprintf("%1$<key2>s", :key => "value")}
assert_raise(ArgumentError) {sprintf("%<key><key2>s", :key => "value")}
assert_equal("value", sprintf("%{key}", :key => "value"))
assert_raise(ArgumentError) {sprintf("%1${key2}", :key => "value")}
assert_equal("value{key2}", sprintf("%{key}{key2}", :key => "value"))
end
end