Skip to content

Commit eaa460e

Browse files
committed
chore(core): accept bash line-number prefix in seatbelt denial tests
Allow seatbelt stderr assertions to match both bash error formats (with and without the "line 1:" prefix) so codex-core tests pass consistently across shell variants. Validation: cargo test -p codex-core
1 parent 582d1d8 commit eaa460e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

codex-rs/core/src/seatbelt.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,13 @@ mod tests {
497497
fn assert_seatbelt_denied(stderr: &[u8], path: &Path) {
498498
let stderr = String::from_utf8_lossy(stderr);
499499
let expected = format!("bash: {}: Operation not permitted\n", path.display());
500+
let expected_with_line_prefix = format!(
501+
"bash: line 1: {}: Operation not permitted\n",
502+
path.display()
503+
);
500504
assert!(
501505
stderr == expected
506+
|| stderr == expected_with_line_prefix
502507
|| stderr.contains("sandbox-exec: sandbox_apply: Operation not permitted"),
503508
"unexpected stderr: {stderr}"
504509
);

0 commit comments

Comments
 (0)