mirror of
https://github.com/openai/codex.git
synced 2026-04-26 07:35:29 +00:00
migrating execpolicy -> execpolicy-legacy and execpolicy2 -> execpolicy (#6956)
This commit is contained in:
23
codex-rs/execpolicy-legacy/tests/suite/parse_sed_command.rs
Normal file
23
codex-rs/execpolicy-legacy/tests/suite/parse_sed_command.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use codex_execpolicy_legacy::Error;
|
||||
use codex_execpolicy_legacy::parse_sed_command;
|
||||
|
||||
#[test]
|
||||
fn parses_simple_print_command() {
|
||||
assert_eq!(parse_sed_command("122,202p"), Ok(()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rejects_malformed_print_command() {
|
||||
assert_eq!(
|
||||
parse_sed_command("122,202"),
|
||||
Err(Error::SedCommandNotProvablySafe {
|
||||
command: "122,202".to_string(),
|
||||
})
|
||||
);
|
||||
assert_eq!(
|
||||
parse_sed_command("122202"),
|
||||
Err(Error::SedCommandNotProvablySafe {
|
||||
command: "122202".to_string(),
|
||||
})
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user