| skipped 90 lines |
91 | 91 | | } |
92 | 92 | | |
93 | 93 | | #[test] |
| 94 | + | fn args_parse_version_flags() { |
| 95 | + | let mut options = Options::default(); |
| 96 | + | options.version = true; |
| 97 | + | options.text = String::from("-v"); |
| 98 | + | assert_eq!(parse(vec!["path/to/bin".to_string(), "-v".to_string()]).unwrap(), options); |
| 99 | + | options.text = String::from("-V"); |
| 100 | + | assert_eq!(parse(vec!["path/to/bin".to_string(), "-V".to_string()]).unwrap(), options); |
| 101 | + | options.text = String::from("--version"); |
| 102 | + | assert_eq!(parse(vec!["path/to/bin".to_string(), "--version".to_string()]).unwrap(), options); |
| 103 | + | } |
| 104 | + | |
| 105 | + | #[test] |
| 106 | + | fn args_parse_help_flags() { |
| 107 | + | let mut options = Options::default(); |
| 108 | + | options.help = true; |
| 109 | + | options.text = String::from("-h"); |
| 110 | + | assert_eq!(parse(vec!["path/to/bin".to_string(), "-h".to_string()]).unwrap(), options); |
| 111 | + | options.text = String::from("--help"); |
| 112 | + | assert_eq!(parse(vec!["path/to/bin".to_string(), "--help".to_string()]).unwrap(), options); |
| 113 | + | } |
| 114 | + | |
| 115 | + | #[test] |
94 | 116 | | fn args_parse_boolean_flags() { |
95 | 117 | | let mut options = Options::default(); |
96 | 118 | | options.text = String::from("my text"); |
| skipped 1723 lines |