Merge PR #15192: fix(xtask): reject unknown corpus arguments before fetching

Conflict: both sides added tests at the top of xtask/src/corpus/tests.rs; kept both.
This commit is contained in:
David Mann committed 2026-11-22 00:29:42 +01:00
commit eb6213cea3
2 files changed
+14

No files matched your search

+7
View File
@@ -32,6 +32,13 @@ fn is_critical(path: &str) -> bool {
/// `cargo xtask corpus [--all | --pngsuite | --download | --psd | --psd-tools | --heif | --exr | --pixls | --affinity | --atn | --photoshop [--local] | --gimp [--local]] [--update-manifest]`
pub fn cmd(args: &[&str]) -> Result<(), String> {
for arg in args {
match *arg {
"--all" | "--pngsuite" | "--download" | "--psd" | "--psd-tools" | "--heif" | "--pixls" | "--exr" | "--affinity" | "--atn" | "--photoshop"
| "--gimp" | "--local" | "--update-manifest" => {}
other => return Err(format!("corpus: unknown argument `{other}`")),
}
}
let update = args.contains(&"--update-manifest");
let mut did = false;
if args.contains(&"--all") {
+7
View File
@@ -1,5 +1,12 @@
use super::*;
#[test]
fn corpus_rejects_unknown_arguments_before_fetching() {
for args in [vec!["--psd-tool"], vec!["--all", "--psd-tool"], vec!["--psd-tool", "--all"]] {
assert_eq!(cmd(&args), Err("corpus: unknown argument `--psd-tool`".into()));
}
}
#[test]
fn changed_atn_root_triggers_corpus_tests() {
assert!(is_critical("crates/engine/src/cmd/atn_cmds.rs"));