Relax tests for windows
authorAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 10 Mar 2018 15:30:24 +0000 (18:30 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 10 Mar 2018 15:46:32 +0000 (18:46 +0300)
On windows, clap prints `cargo.exe` rather than just `cargo`.

tests/testsuite/build.rs
tests/testsuite/cargo_command.rs
tests/testsuite/init.rs
tests/testsuite/metadata.rs
tests/testsuite/new.rs
tests/testsuite/run.rs
tests/testsuite/rustc.rs

index 615edf2db9963fca9a659664ed5c5480e87a713b..2987b9db164e5fe4bde591b358151d26293e5080 100644 (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
 "));
 }
 
index 7944fbeed0495725254301b82c4eeef485e909fb..955905c3eba5a134761ba43a0687a21e7c6af63f 100644 (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
index f80aedf52233042238a4afd3a0ffac0b8601ee92..8f79ae6b4c08d61986dbc79096aa21a6a1b6fbf4 100644 (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
 "));
 }
 
index 296e6f3f0269bf4acbaa3098d7cc969978f25bb7..a7711659801ff5be25d1962a4c830117228947fe 100644 (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]
index ab30b20624587257261f0b507b5688b86a3c2a31..bc54182106649f4f78909559c4dcf8915f8b1b86 100644 (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
 "));
 }
 
index 0d123d05afd643ae8f8842626397a294c190facb..22678ca23760d738c98d7c9fe0c1f33dc20e39c7 100644 (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()
index 72629f6b306abbe0fec02a430a6d9b1f15723165..ab5cb8d7bb62c131da8c93c1961e482c8925d6ae 100644 (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]