fix: last RV11 gaps - bench enum args, theme NUL paths, Zig error names
Resolves the 3 remaining gaps in docs/rewrite/notes/review-rv11-codex.md (final-Z14.md): - ghostty-bench validates every occurrence of enum options in order (Args::take_enum; empty value resets) like cli/args.zig, so `--mode=bad --mode=noop` fails as in Zig. - Theme paths with an interior NUL open the prefix like Zig's C-string path handling (verified against /usr/bin/ghostty). - Filesystem diagnostics print Zig's error names (error.FileNotFound, NotDir, AccessDenied, IsDir, NameTooLong, SymLinkLoop, ...) via a shared ghostty_os::zig_error mapping used by theme/path/config-file/ file_load/edit-config/list-themes; messages match the oracle. Test Plan: - cargo test --workspace --no-fail-fast - just check-macos (both), just check-windows, just check-wasm
This commit is contained in:
1 parent
64aa8b6793
commit
4bbe0d7fe9
12 files changed
+215
-89
No files matched your search
@@ -40,11 +40,14 @@ fn run() -> Result<(), String> {
|
||||
}
|
||||
"osc" => {
|
||||
let p_valid = args.take("p-valid", 0.5f64)?;
|
||||
let style = match args.take_opt_string("style")?.as_deref() {
|
||||
None | Some("streaming") => OscStyle::Streaming,
|
||||
Some("parser") => OscStyle::Parser,
|
||||
Some(s) => return Err(format!("invalid value for --style: {s}")),
|
||||
};
|
||||
let style = args.take_enum(
|
||||
"style",
|
||||
OscStyle::Streaming,
|
||||
&[
|
||||
("streaming", OscStyle::Streaming),
|
||||
("parser", OscStyle::Parser),
|
||||
],
|
||||
)?;
|
||||
args.finish()?;
|
||||
run_osc(&mut out, &mut rng, p_valid, style)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user