mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 23:04:23 +00:00
tests: adds regression tests for custom usage strings
This commit is contained in:
parent
a442211b39
commit
1a97f4fb95
1 changed files with 25 additions and 0 deletions
|
@ -136,6 +136,19 @@ OPTIONS:
|
|||
-O, --opt <opt> tests options
|
||||
-o, --option <option>... tests options";
|
||||
|
||||
static RIPGREP_USAGE: &'static str = "ripgrep 0.5
|
||||
|
||||
USAGE:
|
||||
rg [OPTIONS] <pattern> [<path> ...]
|
||||
rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...]
|
||||
rg [OPTIONS] --files [<path> ...]
|
||||
rg [OPTIONS] --type-list
|
||||
|
||||
FLAGS:
|
||||
-h, --help Prints help information
|
||||
-V, --version Prints version information";
|
||||
|
||||
|
||||
static MULTI_SC_HELP: &'static str = "ctest-subcmd-multi 0.1
|
||||
Kevin K. <kbknapp@gmail.com>
|
||||
tests subcommands
|
||||
|
@ -664,6 +677,18 @@ fn issue_760() {
|
|||
assert!(test::compare_output(app, "ctest --help", ISSUE_760, false));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ripgrep_usage() {
|
||||
let app = App::new("ripgrep")
|
||||
.version("0.5")
|
||||
.usage("rg [OPTIONS] <pattern> [<path> ...]
|
||||
rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...]
|
||||
rg [OPTIONS] --files [<path> ...]
|
||||
rg [OPTIONS] --type-list");
|
||||
|
||||
assert!(test::compare_output(app, "ripgrep --help", RIPGREP_USAGE, false));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hidden_args() {
|
||||
let app = App::new("prog")
|
||||
|
|
Loading…
Reference in a new issue