Disable tests on backtraces w/ unknown line numbers

This commit is contained in:
fundamental
2021-03-30 20:21:44 -04:00
parent 49f0da6821
commit c146e81c4a
3 changed files with 8 additions and 1 deletions
+3
View File
@@ -20,6 +20,9 @@ assert('Kernel.caller, Kernel#caller') do
bar(*args)
end
end
skip "backtrace isn't available" if(c.new.baz(0)[0].include?("unknown"))
assert_equal "kernel.rb:#{caller_lineno}:in foo", c.new.baz(0)[0][-19..-1]
assert_equal "bar", c.new.baz[0][-3..-1]
assert_equal "foo", c.new.baz(0)[0][-3..-1]
+3
View File
@@ -7,6 +7,9 @@ def enable_debug_info?
raise
rescue => e
@enable_debug_info = !e.backtrace.empty?
if(@enable_debug_info && e.backtrace[0].include?("(unknown)"))
@enable_debug_info = false
end
end
end
+2 -1
View File
@@ -382,7 +382,8 @@ def backtrace_available?
begin
raise "XXX"
rescue => exception
not exception.backtrace.empty?
return false if exception.backtrace.empty?
not exception.backtrace[0].include?("unknown")
end
end