diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-26 20:13:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-26 20:13:07 +0000 |
commit | d249b047c234879ca70e036f5fd686c2a893af94 (patch) | |
tree | d42c11d21ee91d9efc91316b230ed0ea46e9d4cf /test | |
parent | 6a4061ce300eec937d56472690e151b5a07b30cd (diff) |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_exception.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |