mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
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
This commit is contained in:
parent
f961bad191
commit
bae19b5547
2 changed files with 11 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue