Chih-Hung Hsieh | be338a1 | 2020-10-26 13:16:51 -0700 | [diff] [blame^] | 1 | use structopt::StructOpt; |
2 | |||||
3 | mod utils; | ||||
4 | use utils::*; | ||||
5 | |||||
6 | #[test] | ||||
7 | fn invisible_group_issue_439() { | ||||
8 | macro_rules! m { | ||||
9 | ($bool:ty) => { | ||||
10 | #[derive(Debug, StructOpt)] | ||||
11 | struct Opts { | ||||
12 | #[structopt(long = "x")] | ||||
13 | x: $bool, | ||||
14 | } | ||||
15 | }; | ||||
16 | } | ||||
17 | |||||
18 | m!(bool); | ||||
19 | |||||
20 | let help = get_long_help::<Opts>(); | ||||
21 | |||||
22 | assert!(help.contains("--x")); | ||||
23 | assert!(!help.contains("--x <x>")); | ||||
24 | Opts::from_iter_safe(&["test", "--x"]).unwrap(); | ||||
25 | } |