1 use structopt::StructOpt;
2 
3 mod utils;
4 use utils::*;
5 
6 #[test]
invisible_group_issue_439()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 }
26 
27 #[test]
issue_447()28 fn issue_447() {
29     macro_rules! Command {
30         ( $name:ident, [
31         #[$meta:meta] $var:ident($inner:ty)
32       ] ) => {
33             #[derive(Debug, PartialEq, structopt::StructOpt)]
34             enum $name {
35                 #[$meta]
36                 $var($inner),
37             }
38         };
39     }
40 
41     Command! {GitCmd, [
42       #[structopt(external_subcommand)]
43       Ext(Vec<String>)
44     ]}
45 }
46