loopd, bxctl, inferproxy: read args_os instead of panicking
M3a review finding 7, for the other three roles. loopd keeps its config path as a path; bxctl and inferproxy take text arguments and answer one that is not UTF-8 with their usage. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
//! An argument that is not UTF-8 is a usage error, not a panic (M3a review finding 7).
|
||||
|
||||
use std::ffi::OsStr;
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
use std::process::Command;
|
||||
|
||||
#[test]
|
||||
fn an_argument_that_is_not_utf8_is_a_usage_error() {
|
||||
let out = Command::new(env!("CARGO_BIN_EXE_inferproxy"))
|
||||
.args([OsStr::new("--listen"), OsStr::from_bytes(b"/tmp/\xff.sock")])
|
||||
.output()
|
||||
.unwrap();
|
||||
assert_eq!(out.status.code(), Some(2));
|
||||
}
|
||||
Reference in New Issue
Block a user