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 | 10c87aa3b5b5a9df59a25f5273345dde57f1b707 (patch) | |
tree | d42c11d21ee91d9efc91316b230ed0ea46e9d4cf /test/ruby/test_exception.rb | |
parent | fe2959cb300018d3872a0c274aed1e14b5a9be45 (diff) | |
download | ruby-10c87aa3b5b5a9df59a25f5273345dde57f1b707.tar.gz |
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/ruby/test_exception.rb')
-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 |