error.c: send as a single string

* error.c (rb_warn_m): send the arguments as a single string
  concatenated with a newline, so it can be filtered easily.
  [ruby-core:80875] [Feature #12944]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-04-26 20:13:07 +00:00
parent 6a4061ce30
commit d249b047c2
2 changed files with 23 additions and 2 deletions

View file

@ -973,6 +973,10 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
def test_warning_warn
warning = capture_warning_warn {@a}
assert_match(/instance variable @a not initialized/, warning[0])
assert_equal(["a\nz\n"], capture_warning_warn {warn "a\n", "z"})
assert_equal([], capture_warning_warn {warn})
assert_equal(["\n"], capture_warning_warn {warn ""})
end
def test_warning_warn_invalid_argument