ruby-changes:68332
From: Nobuyoshi <ko1@a...>
Date: Sat, 9 Oct 2021 18:30:57 +0900 (JST)
Subject: [ruby-changes:68332] fc913ad21d (master): Exclude also core_assertions.rb from backtraces
https://git.ruby-lang.org/ruby.git/commit/?id=fc913ad21d From fc913ad21dcb04bd3d3786f9a3072a6717a52a9a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 9 Oct 2021 16:17:37 +0900 Subject: Exclude also core_assertions.rb from backtraces --- tool/lib/test/unit.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index c489e5ab66..c113e7e4fd 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -21,14 +21,15 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L21 return ["No backtrace"] unless bt new_bt = [] + pattern = %r[/(?:lib\/test/|core_assertions\.rb:)] unless $DEBUG then bt.each do |line| - break if line =~ /lib\/test/ + break if pattern.match?(line) new_bt << line end - new_bt = bt.reject { |line| line =~ /lib\/test/ } if new_bt.empty? + new_bt = bt.reject { |line| pattern.match?(line) } if new_bt.empty? new_bt = bt.dup if new_bt.empty? else new_bt = bt.dup -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/