Get the last n lines of text.
(text, n=100)
| 139 | |
| 140 | |
| 141 | def _get_last_n_lines(text, n=100): |
| 142 | """Get the last n lines of text.""" |
| 143 | lines = text.strip().split("\n") |
| 144 | if len(lines) <= n: |
| 145 | return text |
| 146 | return f"... (truncated, showing last {n} lines) ...\n" + "\n".join(lines[-n:]) |
| 147 | |
| 148 | |
| 149 | def run_command_and_validate(cmd, baseline_path, log_file, working_dir=None, tolerance=1e-6, timeout=3600): |
no test coverage detected