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
This commit is contained in:
nobu 2014-06-26 13:30:08 +00:00
parent 767358108e
commit 57d6cb4af9
2 changed files with 7 additions and 1 deletions

View file

@ -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