From d249b047c234879ca70e036f5fd686c2a893af94 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 26 Apr 2017 20:13:07 +0000 Subject: 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 --- test/ruby/test_exception.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 8a8edd2ff2..e53569c158 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -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 -- cgit v1.2.3