From 30a8dbc861a03d881b7f058cd1a111c1222b66d6 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Sat, 29 Jun 2024 03:42:43 +0900 Subject: [PATCH] maximum showing line number on btest failure 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. --- bootstraptest/runner.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb index 3e54318ac9564e..764c4898dd5aee 100755 --- a/bootstraptest/runner.rb +++ b/bootstraptest/runner.rb @@ -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