mirror of
https://github.com/openai/codex.git
synced 2026-09-14 11:57:03 +00:00
Fix some stuff
This commit is contained in:
@@ -507,7 +507,7 @@ mod tests {
|
||||
];
|
||||
|
||||
let rendered = render_stdin_events(&events);
|
||||
assert_eq!(rendered, "first\nsecond");
|
||||
assert_eq!(rendered, "first\n> [no output]\nsecond\n> out");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -23,7 +23,7 @@ use textwrap::WordSplitter;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
pub(crate) const TOOL_CALL_MAX_LINES: usize = 5;
|
||||
const USER_SHELL_TOOL_CALL_MAX_LINES: usize = usize::MAX;
|
||||
const USER_SHELL_TOOL_CALL_MAX_LINES: usize = 50;
|
||||
|
||||
pub(crate) struct OutputLinesParams {
|
||||
pub(crate) line_limit: usize,
|
||||
@@ -524,44 +524,6 @@ struct ExecDisplayLayout {
|
||||
output_max_lines: usize,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn user_shell_output_shows_all_lines() {
|
||||
let aggregated_output = (0..12)
|
||||
.map(|idx| format!("line {idx}"))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
let command_output = CommandOutput {
|
||||
exit_code: 0,
|
||||
aggregated_output,
|
||||
formatted_output: String::new(),
|
||||
};
|
||||
|
||||
let output = output_lines(
|
||||
Some(&command_output),
|
||||
OutputLinesParams {
|
||||
line_limit: USER_SHELL_TOOL_CALL_MAX_LINES,
|
||||
only_err: false,
|
||||
include_angle_pipe: true,
|
||||
include_prefix: true,
|
||||
},
|
||||
);
|
||||
|
||||
assert_eq!(output.lines.len(), 12);
|
||||
assert!(output.omitted.is_none());
|
||||
assert!(
|
||||
output
|
||||
.lines
|
||||
.iter()
|
||||
.all(|line| line.spans.iter().all(|span| !span.content.contains('…')))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
impl ExecDisplayLayout {
|
||||
const fn new(
|
||||
command_continuation: PrefixedBlock,
|
||||
@@ -583,4 +545,4 @@ const EXEC_DISPLAY_LAYOUT: ExecDisplayLayout = ExecDisplayLayout::new(
|
||||
2,
|
||||
PrefixedBlock::new(" └ ", " "),
|
||||
5,
|
||||
);
|
||||
);
|
||||
Reference in New Issue
Block a user