mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-17 15:34:54 +00:00
24 lines
543 B
Rust
24 lines
543 B
Rust
use code_execpolicy::Error;
|
|
use code_execpolicy::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(),
|
|
})
|
|
);
|
|
}
|