summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-09 16:17:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-09 16:17:37 +0900
commitfc913ad21dcb04bd3d3786f9a3072a6717a52a9a (patch)
treecd6d12bd397eb3a3dedc6c09ff475dd82d72ce4e
parent3932227d96ada8d63873d1b5a66c6f4b2df188aa (diff)
Exclude also core_assertions.rb from backtraces
-rw-r--r--tool/lib/test/unit.rb5
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