aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_sprintf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-26 13:30:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-26 13:30:08 +0000
commit57d6cb4af92892de6f9b54b58747dc5432d6d03c (patch)
treede9c39559a21ae48c807bc444f33389c2e74452f /test/ruby/test_sprintf.rb
parent767358108ecfd71055f6c75d14f439f3b6b43efb (diff)
downloadruby-57d6cb4af92892de6f9b54b58747dc5432d6d03c.tar.gz
sprintf.c: remove extra parentheses
* sprintf.c (GETASTER): remove extra parentheses from the second argument so that the error message does not contain them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_sprintf.rb')
-rw-r--r--test/ruby/test_sprintf.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb
index a57509f458..2a0fc487c1 100644
--- a/test/ruby/test_sprintf.rb
+++ b/test/ruby/test_sprintf.rb
@@ -309,6 +309,12 @@ class TestSprintf < Test::Unit::TestCase
def test_star
assert_equal("-1 ", sprintf("%*d", -3, -1))
+ assert_raise_with_message(ArgumentError, /width too big/) {
+ sprintf("%*999999999999999999999999999999999999999999999999999999999999$d", 1)
+ }
+ assert_raise_with_message(ArgumentError, /prec too big/) {
+ sprintf("%.*999999999999999999999999999999999999999999999999999999999999$d", 1)
+ }
end
def test_escape