From bae19b5547745dbf04310ca6bcb3c4e063e5b7b2 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 2 Apr 2018 11:39:10 +0000 Subject: error.c: prepend "warning: " always * error.c (rb_warn_m): prepend the string "warning: " if uplevel keyword is given, even if caller file and line information are not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test/ruby') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 574ffbc537..61521cbfff 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1121,6 +1121,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| warning = capture_warning_warn {obj.w(1)} assert_equal("#{__FILE__}:#{__LINE__-1}: warning: test warning\n", warning[0]) assert_raise(ArgumentError) {warn("test warning", uplevel: -1)} + assert_in_out_err(["-e", "warn 'ok', uplevel: 1"], '', [], /warning:/) end def test_warning_warn_invalid_argument -- cgit v1.2.3