From acde55201b35c5d1d8d08bcd4273d3adfb6115cf Mon Sep 17 00:00:00 2001 From: eregon Date: Thu, 27 Apr 2017 12:07:43 +0000 Subject: Send the backtrace of the circular require warning as a single String to Warning.warn * load.c: send as a single string. * error.c: expose the string formatted by rb_warning as rb_warning_string(). * test/ruby/test_exception.rb: update tests. [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index e53569c158..db13db76d6 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1005,9 +1005,9 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| $LOAD_PATH.pop $LOADED_FEATURES.delete(t) end + assert_equal(1, warning.size) assert_match(/circular require/, warning.first) - warning.pop while %r[lib/rubygems/core_ext/kernel_require.rb:] =~ warning.last - assert_operator(warning.last, :start_with?, "\tfrom #{path}:1:") + assert_match(/^\tfrom #{Regexp.escape(path)}:1:/, warning.first) end def test_undefined_backtrace -- cgit v1.2.3