summaryrefslogtreecommitdiff
path: root/test/ruby/test_sprintf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-18 07:18:56 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-18 07:18:56 +0000
commit68543f30921c52cb1bf5c041879a232b41ba6580 (patch)
treef09cede74019f7be21cee0ba0a5703cc0c147060 /test/ruby/test_sprintf.rb
parentc719cd9b463049932ae1dc1af5a6a1b50609cbef (diff)
use ML ref. for assertion message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_sprintf.rb')
-rw-r--r--test/ruby/test_sprintf.rb27
1 files changed, 11 insertions, 16 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb
index 018486baae..01b7b904e9 100644
--- a/test/ruby/test_sprintf.rb
+++ b/test/ruby/test_sprintf.rb
@@ -144,35 +144,30 @@ class TestSprintf < Test::Unit::TestCase
end
def test_invalid
- # [ruby-core:11569]
-
# Star precision before star width:
- assert_raise(ArgumentError) {sprintf("%.**d", 5, 10, 1)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.**d", 5, 10, 1)}
# Precision before flags and width:
- assert_raise(ArgumentError) {sprintf("%.5+05d", 5)}
- assert_raise(ArgumentError) {sprintf("%.5 5d", 5)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.5+05d", 5)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.5 5d", 5)}
# Overriding a star width with a numeric one:
- assert_raise(ArgumentError) {sprintf("%*1s", 5, 1)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%*1s", 5, 1)}
# Width before flags:
- assert_raise(ArgumentError) {sprintf("%5+0d", 1)}
- assert_raise(ArgumentError) {sprintf("%5 0d", 1)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%5+0d", 1)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%5 0d", 1)}
# Specifying width multiple times:
- assert_raise(ArgumentError) {sprintf("%50+30+20+10+5d", 5)}
- assert_raise(ArgumentError) {sprintf("%50 30 20 10 5d", 5)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%50+30+20+10+5d", 5)}
+ assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%50 30 20 10 5d", 5)}
- # [ruby-core:11570]
# Specifying the precision multiple times with negative star arguments:
- assert_raise(ArgumentError) {sprintf("%.*.*.*.*f", -1, -1, -1, 5, 1)}
+ assert_raise(ArgumentError, "[ruby-core:11570]") {sprintf("%.*.*.*.*f", -1, -1, -1, 5, 1)}
- # [ruby-core:11571]
# Null bytes after percent signs are removed:
- assert_equal("%\0x hello", sprintf("%\0x hello"))
+ assert_equal("%\0x hello", sprintf("%\0x hello"), "[ruby-core:11571]")
- # [ruby-core:11573]
- assert_raise(ArgumentError) {sprintf("%.25555555555555555555555555555555555555s", "hello")}
+ assert_raise(ArgumentError, "[ruby-core:11573]") {sprintf("%.25555555555555555555555555555555555555s", "hello")}
end
end