Relax tests for windows

On windows, clap prints `cargo.exe` rather than just `cargo`.
This commit is contained in:
Aleksey Kladov 2018-03-10 18:30:24 +03:00
parent 823f1ff32a
commit a64df78ea6
7 changed files with 12 additions and 52 deletions

View File

@ -3250,15 +3250,9 @@ fn wrong_message_format_option() {
assert_that(p.cargo("build").arg("--message-format").arg("XML"),
execs().with_status(1)
.with_stderr("\
.with_stderr_contains("\
error: 'XML' isn't a valid value for '--message-format <FMT>'
<tab>[possible values: human, json]
USAGE:
cargo build --message-format <FMT>
For more information try --help
"));
}

View File

@ -102,16 +102,10 @@ fn find_closest_biuld_to_build() {
assert_that(pr,
execs().with_status(1)
.with_stderr("\
.with_stderr_contains("\
error: The subcommand 'biuld' wasn't recognized
<tab>Did you mean 'build'?
If you believe you received this message in error, try re-running with 'cargo -- biuld'
USAGE:
cargo [OPTIONS] [SUBCOMMAND]
For more information try --help"));
"));
}
// if a subcommand is more than 3 edit distance away, we don't make a suggestion

View File

@ -443,13 +443,8 @@ fn with_argument() {
fn unknown_flags() {
assert_that(cargo_process("init").arg("foo").arg("--flag"),
execs().with_status(1)
.with_stderr("\
.with_stderr_contains("\
error: Found argument '--flag' which wasn't expected, or isn't valid in this context
USAGE:
cargo init [OPTIONS] [--] [path]
For more information try --help
"));
}

View File

@ -753,15 +753,10 @@ fn cargo_metadata_bad_version() {
.arg("--format-version").arg("2")
.cwd(p.root()),
execs().with_status(1)
.with_stderr("\
.with_stderr_contains("\
error: '2' isn't a valid value for '--format-version <VERSION>'
<tab>[possible values: 1]
USAGE:
cargo metadata --format-version <VERSION> --no-deps
For more information try --help"));
"));
}
#[test]

View File

@ -103,14 +103,9 @@ fn simple_git() {
fn no_argument() {
assert_that(cargo_process("new"),
execs().with_status(1)
.with_stderr("\
.with_stderr_contains("\
error: The following required arguments were not provided:
<path>
USAGE:
cargo new [OPTIONS] <path>
For more information try --help
"));
}
@ -375,13 +370,8 @@ fn subpackage_git_with_vcs_arg() {
fn unknown_flags() {
assert_that(cargo_process("new").arg("foo").arg("--flag"),
execs().with_status(1)
.with_stderr("\
.with_stderr_contains("\
error: Found argument '--flag' which wasn't expected, or isn't valid in this context
USAGE:
cargo new [OPTIONS] <path>
For more information try --help
"));
}

View File

@ -809,13 +809,9 @@ fn run_multiple_packages() {
assert_that(cargo().arg("-p").arg("d1").arg("-p").arg("d2"),
execs()
.with_status(1)
.with_stderr("\
.with_stderr_contains("\
error: The argument '--package <SPEC>' was provided more than once, but cannot be used multiple times
USAGE:
cargo run --message-format <FMT> --package <SPEC>
For more information try --help"));
"));
assert_that(cargo().arg("-p").arg("d3"),
execs()

View File

@ -355,14 +355,10 @@ fn fail_with_multiple_packages() {
assert_that(foo.cargo("rustc").arg("-v").arg("-p").arg("bar")
.arg("-p").arg("baz"),
execs().with_status(1).with_stderr("\
execs().with_status(1).with_stderr_contains("\
error: The argument '--package <SPEC>' was provided more than once, \
but cannot be used multiple times
USAGE:
cargo rustc --message-format <FMT> --package <SPEC> --verbose
For more information try --help"));
"));
}
#[test]