Skip to content

Commit

Permalink
maximum showing line number on btest failure
Browse files Browse the repository at this point in the history
Some tests in btest uses long src for btest and it is harmful to
check the results. This patch introducing the limitation how many
lines of code is shown on failure.
  • Loading branch information
ko1 committed Jul 1, 2024
1 parent 15ceb95 commit e0b14ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bootstraptest/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ def show_limit(testsrc, opt = '', **argh)

def pretty(src, desc, result)
src = src.sub(/\A\s*\n/, '')
lines = src.lines
src = lines[0..20].join + "(...snip)\n" if lines.size > 20
(/\n/ =~ src ? "\n#{adjust_indent(src)}" : src) + " #=> #{desc}"
end

Expand Down

0 comments on commit e0b14ca

Please sign in to comment.