diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-03 16:34:45 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-03 16:34:45 +0900 |
| commit | 9fe8653e8634db169529657109a4b69ac38862d7 (patch) | |
| tree | ab609629e0096e38d1aa34f23b9a9c139a5de210 /mrbgems/mruby-sprintf/test/sprintf.rb | |
| parent | 427ea605e7408fd2ed3b5c97d701c660b8028788 (diff) | |
| parent | 4380f861503fc441a00aee9d16b5b074f3cbc158 (diff) | |
| download | mruby-9fe8653e8634db169529657109a4b69ac38862d7.tar.gz mruby-9fe8653e8634db169529657109a4b69ac38862d7.zip | |
Merge branch 'iij-pr-string-percent'
Diffstat (limited to 'mrbgems/mruby-sprintf/test/sprintf.rb')
| -rw-r--r-- | mrbgems/mruby-sprintf/test/sprintf.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mrbgems/mruby-sprintf/test/sprintf.rb b/mrbgems/mruby-sprintf/test/sprintf.rb index 52e94fb83..7007df1fa 100644 --- a/mrbgems/mruby-sprintf/test/sprintf.rb +++ b/mrbgems/mruby-sprintf/test/sprintf.rb @@ -1,3 +1,8 @@ -## -# Kernel#sprintf Kernel#format Test +#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" } +end |
