diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-10-09 16:17:37 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-10-09 16:17:37 +0900 |
commit | fc913ad21dcb04bd3d3786f9a3072a6717a52a9a (patch) | |
tree | cd6d12bd397eb3a3dedc6c09ff475dd82d72ce4e /tool/lib | |
parent | 3932227d96ada8d63873d1b5a66c6f4b2df188aa (diff) | |
download | ruby-fc913ad21dcb04bd3d3786f9a3072a6717a52a9a.tar.gz |
Exclude also core_assertions.rb from backtraces
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/test/unit.rb | 5 |
1 files 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 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 |