summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-02 11:39:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-02 11:39:10 +0000
commitbae19b5547745dbf04310ca6bcb3c4e063e5b7b2 (patch)
treed46c7c2cfbd697cf804ab9eaed0f3436c4deb1fb /test
parentf961bad19172b86158cc4c70bd3b2b5a26cd7ea8 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb1
1 files changed, 1 insertions, 0 deletions
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