Follow-up from PR #7481
This commit is contained in:
parent
3e6cd5660c
commit
edd98dd3b7
1 changed files with 0 additions and 43 deletions
|
|
@ -748,49 +748,6 @@ mod tests {
|
|||
assert_snapshot!("transcript_overlay_apply_patch_scroll_vt100", snapshot);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transcript_overlay_wraps_long_exec_output_lines() {
|
||||
let marker = "Z";
|
||||
let long_line = marker.repeat(200);
|
||||
|
||||
let mut exec_cell = crate::exec_cell::new_active_exec_command(
|
||||
"exec-long".into(),
|
||||
vec!["bash".into(), "-lc".into(), "echo long".into()],
|
||||
vec![ParsedCommand::Unknown {
|
||||
cmd: "echo long".into(),
|
||||
}],
|
||||
ExecCommandSource::Agent,
|
||||
None,
|
||||
false,
|
||||
);
|
||||
exec_cell.complete_call(
|
||||
"exec-long",
|
||||
CommandOutput {
|
||||
exit_code: 0,
|
||||
aggregated_output: format!("{long_line}\n"),
|
||||
formatted_output: long_line,
|
||||
},
|
||||
Duration::from_millis(10),
|
||||
);
|
||||
let exec_cell: Arc<dyn HistoryCell> = Arc::new(exec_cell);
|
||||
|
||||
let mut overlay = TranscriptOverlay::new(vec![exec_cell]);
|
||||
let area = Rect::new(0, 0, 20, 10);
|
||||
let mut buf = Buffer::empty(area);
|
||||
|
||||
overlay.render(area, &mut buf);
|
||||
let rendered = buffer_to_text(&buf, area);
|
||||
|
||||
let wrapped_lines = rendered
|
||||
.lines()
|
||||
.filter(|line| line.contains(marker))
|
||||
.count();
|
||||
assert!(
|
||||
wrapped_lines >= 2,
|
||||
"expected long exec output to wrap into multiple lines in transcript overlay, got:\n{rendered}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transcript_overlay_keeps_scroll_pinned_at_bottom() {
|
||||
let mut overlay = TranscriptOverlay::new(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue