File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,8 @@ fn format_exec_output_reports_omitted_lines_and_keeps_head_and_tail() {
385385 // With marker overhead (3 lines), available content lines = 256 - 3 = 253
386386 // Head: 126, Tail: 127, Omitted: 356 - 253 = 103
387387 const OMISSION_MARKER_LINES : usize = 3 ;
388- let available_content_lines = truncate:: MODEL_FORMAT_MAX_LINES . saturating_sub ( OMISSION_MARKER_LINES ) ;
388+ let available_content_lines =
389+ truncate:: MODEL_FORMAT_MAX_LINES . saturating_sub ( OMISSION_MARKER_LINES ) ;
389390 let omitted = total_lines - available_content_lines;
390391 let expected_marker = format ! ( "[... omitted {omitted} of {total_lines} lines ...]" ) ;
391392
@@ -418,7 +419,8 @@ fn format_exec_output_prefers_line_marker_when_both_limits_exceeded() {
418419 // With marker overhead (3 lines), available content lines = 256 - 3 = 253
419420 // Omitted: 298 - 253 = 45
420421 const OMISSION_MARKER_LINES : usize = 3 ;
421- let available_content_lines = truncate:: MODEL_FORMAT_MAX_LINES . saturating_sub ( OMISSION_MARKER_LINES ) ;
422+ let available_content_lines =
423+ truncate:: MODEL_FORMAT_MAX_LINES . saturating_sub ( OMISSION_MARKER_LINES ) ;
422424 let omitted = total_lines - available_content_lines;
423425 let expected_marker = format ! ( "[... omitted {omitted} of {total_lines} lines ...]" ) ;
424426
Original file line number Diff line number Diff line change @@ -236,10 +236,12 @@ async fn user_shell_command_output_is_truncated_in_history() -> anyhow::Result<(
236236 . expect ( "command message recorded in request" ) ;
237237 let command_message = command_message. replace ( "\r \n " , "\n " ) ;
238238
239- let head = ( 1 ..=128 ) . map ( |i| format ! ( "{i}\n " ) ) . collect :: < String > ( ) ;
240- let tail = ( 273 ..=400 ) . map ( |i| format ! ( "{i}\n " ) ) . collect :: < String > ( ) ;
239+ // With marker overhead (3 lines), available content lines = 256 - 3 = 253
240+ // Head: 126, Tail: 127, Omitted: 400 - 253 = 147
241+ let head = ( 1 ..=126 ) . map ( |i| format ! ( "{i}\n " ) ) . collect :: < String > ( ) ;
242+ let tail = ( 274 ..=400 ) . map ( |i| format ! ( "{i}\n " ) ) . collect :: < String > ( ) ;
241243 let truncated_body =
242- format ! ( "Total output lines: 400\n \n {head}\n [... omitted 144 of 400 lines ...]\n \n {tail}" ) ;
244+ format ! ( "Total output lines: 400\n \n {head}\n [... omitted 147 of 400 lines ...]\n \n {tail}" ) ;
243245 let escaped_command = escape ( & command) ;
244246 let escaped_truncated_body = escape ( & truncated_body) ;
245247 let expected_pattern = format ! (
You can’t perform that action at this time.
0 commit comments