• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:utils

3 use crate::utils;
5 fn common() -> Command { in common()
6 Command::new("foo").help_template(utils::FULL_TEMPLATE) in common()
9 fn with_version() -> Command { in with_version()
13 fn with_long_version() -> Command { in with_long_version()
17 fn with_both() -> Command { in with_both()
21 fn with_subcommand() -> Command { in with_subcommand()
25 #[test]
27 let res = common().try_get_matches_from("foo -V".split(' ')); in version_short_flag_no_version()
34 #[test]
36 let res = common().try_get_matches_from("foo --version".split(' ')); in version_long_flag_no_version()
43 #[test]
45 let res = with_version().try_get_matches_from("foo -V".split(' ')); in version_short_flag_with_version()
53 #[test]
55 let res = with_version().try_get_matches_from("foo --version".split(' ')); in version_long_flag_with_version()
63 #[test]
65 let res = with_long_version().try_get_matches_from("foo -V".split(' ')); in version_short_flag_with_long_version()
73 #[test]
75 let res = with_long_version().try_get_matches_from("foo --version".split(' ')); in version_long_flag_with_long_version()
83 #[test]
85 let res = with_both().try_get_matches_from("foo -V".split(' ')); in version_short_flag_with_both()
93 #[test]
95 let res = with_both().try_get_matches_from("foo --version".split(' ')); in version_long_flag_with_both()
103 #[test]
111 -h, --help Print help in help_short_flag_no_version()
114 utils::assert_output(cmd, "foo -h", EXPECTED, false); in help_short_flag_no_version()
117 #[test]
125 -h, --help Print help in help_long_flag_no_version()
128 utils::assert_output(cmd, "foo --help", EXPECTED, false); in help_long_flag_no_version()
131 #[test]
139 -h, --help Print help in help_short_flag_with_version()
140 -V, --version Print version in help_short_flag_with_version()
143 utils::assert_output(cmd, "foo -h", EXPECTED, false); in help_short_flag_with_version()
146 #[test]
154 -h, --help Print help in help_long_flag_with_version()
155 -V, --version Print version in help_long_flag_with_version()
158 utils::assert_output(cmd, "foo --help", EXPECTED, false); in help_long_flag_with_version()
161 #[test]
169 -h, --help Print help in help_short_flag_with_long_version()
170 -V, --version Print version in help_short_flag_with_long_version()
173 utils::assert_output(cmd, "foo -h", EXPECTED, false); in help_short_flag_with_long_version()
176 #[test]
184 -h, --help Print help in help_long_flag_with_long_version()
185 -V, --version Print version in help_long_flag_with_long_version()
188 utils::assert_output(cmd, "foo --help", EXPECTED, false); in help_long_flag_with_long_version()
191 #[test]
199 -h, --help Print help in help_short_flag_with_both()
200 -V, --version Print version in help_short_flag_with_both()
203 utils::assert_output(cmd, "foo -h", EXPECTED, false); in help_short_flag_with_both()
206 #[test]
214 -h, --help Print help in help_long_flag_with_both()
215 -V, --version Print version in help_long_flag_with_both()
218 utils::assert_output(cmd, "foo --help", EXPECTED, false); in help_long_flag_with_both()
221 #[test]
223 … argument, but '--version' is in use by both 'ver' and 'version' (call `cmd.disable_version_flag(t…
234 #[test]
236 …each argument, but '-V' is in use by both 'ver' and 'version' (call `cmd.disable_version_flag(true…
243 #[test]
246 let res = with_subcommand().try_get_matches_from("foo bar --version".split(' ')); in no_propagation_by_default_long()
253 #[test]
255 let res = with_subcommand().try_get_matches_from("foo bar -V".split(' ')); in no_propagation_by_default_short()
262 #[test]
266 .try_get_matches_from("foo bar --version".split(' ')); in propagate_version_long()
273 #[test]
277 .try_get_matches_from("foo bar -V".split(' ')); in propagate_version_short()
285 #[test]
289 .arg(clap::arg!(--version).action(ArgAction::Version)) in version_required()
290 .try_get_matches_from("foo -z".split(' ')); in version_required()
293 #[test]
300 #[test]