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

Fix tests of rb_warning().

* test/ruby/envutil.rb (Test::Unit::Assertions#assert_warning)
  (Test::Unit::Assertions#assert_warn), test/ruby/envutil.rb,
  test/ruby/test_enumerator.rb, test/ruby/test_io_m17n.rb,
  test/ruby/test_regexp.rb, test/ruby/test_syntax.rb:
  assert_warn() and assert_warning() are reversed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2012-11-24 17:14:06 +00:00
parent 7b298723b0
commit 6c1bfbe478
6 changed files with 35 additions and 27 deletions

View file

@ -111,13 +111,13 @@ class TestSyntax < Test::Unit::TestCase
def test_warn_grouped_expression
bug5214 = '[ruby-core:39050]'
assert_warn("", bug5214) do
assert_warning("", bug5214) do
assert_valid_syntax("foo \\\n(\n true)", "test") {$VERBOSE = true}
end
end
def test_warn_unreachable
assert_warn("test:3: warning: statement not reached\n") do
assert_warning("test:3: warning: statement not reached\n") do
code = "loop do\n" "break\n" "foo\n" "end"
assert_valid_syntax(code, "test") {$VERBOSE = true}
end
@ -150,7 +150,7 @@ class TestSyntax < Test::Unit::TestCase
def test_duplicated_when
w = 'warning: duplicated when clause is ignored'
assert_warn(/3: #{w}.+4: #{w}.+4: #{w}.+5: #{w}.+5: #{w}/m){
assert_warning(/3: #{w}.+4: #{w}.+4: #{w}.+5: #{w}.+5: #{w}/m){
eval %q{
case 1
when 1, 1
@ -159,7 +159,7 @@ class TestSyntax < Test::Unit::TestCase
end
}
}
assert_warn(/#{w}/){#/3: #{w}.+4: #{w}.+5: #{w}.+5: #{w}/m){
assert_warning(/#{w}/){#/3: #{w}.+4: #{w}.+5: #{w}.+5: #{w}/m){
a = 1
eval %q{
case 1