MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / visible_subcommands_accept_clap_help

Function visible_subcommands_accept_clap_help

src/cli/parse_tests.rs:30–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29#[test]
30fn visible_subcommands_accept_clap_help() {
31 let command = Cli::command();
32 for path in visible_subcommand_paths(&command) {
33 if path == ["tool"] {
34 continue;
35 }
36
37 let args = std::iter::once("tracedecay".to_string())
38 .chain(path.iter().cloned())
39 .chain(std::iter::once("--help".to_string()));
40 let err = match Cli::try_parse_from(args) {
41 Ok(_) => panic!(
42 "`tracedecay {} --help` should short-circuit parsing",
43 path.join(" ")
44 ),
45 Err(err) => err,
46 };
47 assert_eq!(
48 err.kind(),
49 ErrorKind::DisplayHelp,
50 "`tracedecay {} --help` should display help",
51 path.join(" ")
52 );
53 }
54}
55
56#[test]
57fn every_visible_top_level_subcommand_ships_rich_help() {

Callers

nothing calls this directly

Calls 1

visible_subcommand_pathsFunction · 0.85

Tested by

no test coverage detected