• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 mod common;
2 
3 #[test]
basic()4 fn basic() {
5     let name = "my-app";
6     let cmd = common::basic_command(name);
7     common::assert_matches_path("tests/snapshots/basic.bash.roff", cmd);
8 }
9 
10 #[test]
feature_sample()11 fn feature_sample() {
12     let name = "my-app";
13     let cmd = common::feature_sample_command(name);
14     common::assert_matches_path("tests/snapshots/feature_sample.bash.roff", cmd);
15 }
16 
17 #[test]
special_commands()18 fn special_commands() {
19     let name = "my-app";
20     let cmd = common::special_commands_command(name);
21     common::assert_matches_path("tests/snapshots/special_commands.bash.roff", cmd);
22 }
23 
24 #[test]
quoting()25 fn quoting() {
26     let name = "my-app";
27     let cmd = common::quoting_command(name);
28     common::assert_matches_path("tests/snapshots/quoting.bash.roff", cmd);
29 }
30 
31 #[test]
aliases()32 fn aliases() {
33     let name = "my-app";
34     let cmd = common::aliases_command(name);
35     common::assert_matches_path("tests/snapshots/aliases.bash.roff", cmd);
36 }
37 
38 #[test]
sub_subcommands()39 fn sub_subcommands() {
40     let name = "my-app";
41     let cmd = common::sub_subcommands_command(name);
42     common::assert_matches_path("tests/snapshots/sub_subcommands.bash.roff", cmd);
43 }
44 
45 #[test]
value_hint()46 fn value_hint() {
47     let name = "my-app";
48     let cmd = common::value_hint_command(name);
49     common::assert_matches_path("tests/snapshots/value_hint.bash.roff", cmd);
50 }
51 
52 #[test]
hidden_options()53 fn hidden_options() {
54     let name = "my-app";
55     let cmd = common::hidden_option_command(name);
56     common::assert_matches_path("tests/snapshots/hidden_option.bash.roff", cmd);
57 }
58 
59 #[test]
value_env()60 fn value_env() {
61     let name = "my-app";
62     let cmd = common::env_value_command(name);
63     common::assert_matches_path("tests/snapshots/value_env.bash.roff", cmd);
64 }
65 
66 #[test]
possible_values()67 fn possible_values() {
68     let name = "my-app";
69     let cmd = common::possible_values_command(name);
70     common::assert_matches_path("tests/snapshots/possible_values.bash.roff", cmd);
71 }
72 
73 #[test]
sub_subcommands_help()74 fn sub_subcommands_help() {
75     let name = "my-app";
76     let mut cmd = common::sub_subcommands_command(name);
77     cmd.build();
78     let cmd = cmd
79         .get_subcommands()
80         .find(|cmd| cmd.get_display_name() == Some("my-app-help"));
81     assert!(cmd.is_some(), "help subcommand not found in command");
82     if let Some(cmd) = cmd {
83         common::assert_matches_path("tests/snapshots/sub_subcommand_help.roff", cmd.clone());
84     }
85 }
86