]> git.proxmox.com Git - cargo.git/commitdiff
Update old tests
authorhi-rustin <rustin.liu@gmail.com>
Wed, 17 Aug 2022 14:28:36 +0000 (22:28 +0800)
committerhi-rustin <rustin.liu@gmail.com>
Fri, 19 Aug 2022 02:56:29 +0000 (10:56 +0800)
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
tests/testsuite/build.rs
tests/testsuite/run.rs
tests/testsuite/test.rs

index ace734ba48add4b28e47ce4d29b1cb18a693d8ac..8916340d2c924e304f1f280561b98504ec836111 100644 (file)
@@ -1041,7 +1041,14 @@ fn cargo_compile_with_filename() {
 
     p.cargo("build --bin bin.rs")
         .with_status(101)
-        .with_stderr("[ERROR] no bin target named `bin.rs`")
+        .with_stderr(
+            "\
+[ERROR] no bin target named `bin.rs`.
+Available bin targets:
+    a
+
+",
+        )
         .run();
 
     p.cargo("build --bin a.rs")
@@ -1056,7 +1063,14 @@ fn cargo_compile_with_filename() {
 
     p.cargo("build --example example.rs")
         .with_status(101)
-        .with_stderr("[ERROR] no example target named `example.rs`")
+        .with_stderr(
+            "\
+[ERROR] no example target named `example.rs`.
+Available example targets:
+    a
+
+",
+        )
         .run();
 
     p.cargo("build --example a.rs")
index 0ef9d49cdcf5c822ce228765f1ede70a58c5c12d..667c851231f079e1ae546530a108e68322d46f45 100644 (file)
@@ -503,7 +503,10 @@ automatically infer them to be a target, such as in subfolders.
 
 For more information on this warning you can consult
 https://github.com/rust-lang/cargo/issues/5330
-error: no example target named `a`
+error: no example target named `a`.
+Available example targets:
+    do_magic
+
 ",
         )
         .run();
@@ -528,7 +531,14 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
     let p = autodiscover_examples_project("2015", Some(false));
     p.cargo("run --example a")
         .with_status(101)
-        .with_stderr("error: no example target named `a`\n")
+        .with_stderr(
+            "\
+error: no example target named `a`.
+Available example targets:
+    do_magic
+
+",
+        )
         .run();
 }
 
@@ -600,7 +610,14 @@ fn run_with_filename() {
 
     p.cargo("run --bin bin.rs")
         .with_status(101)
-        .with_stderr("[ERROR] no bin target named `bin.rs`")
+        .with_stderr(
+            "\
+[ERROR] no bin target named `bin.rs`.
+Available bin targets:
+    a
+
+",
+        )
         .run();
 
     p.cargo("run --bin a.rs")
@@ -615,7 +632,14 @@ fn run_with_filename() {
 
     p.cargo("run --example example.rs")
         .with_status(101)
-        .with_stderr("[ERROR] no example target named `example.rs`")
+        .with_stderr(
+            "\
+[ERROR] no example target named `example.rs`.
+Available example targets:
+    a
+
+",
+        )
         .run();
 
     p.cargo("run --example a.rs")
index 95e109d452bf9af63660908b5b37abf686ad52bf..f310d0e5c9d4480fa6733d87625e0c6d77d13cd6 100644 (file)
@@ -2122,11 +2122,21 @@ fn bad_example() {
 
     p.cargo("run --example foo")
         .with_status(101)
-        .with_stderr("[ERROR] no example target named `foo`")
+        .with_stderr(
+            "\
+[ERROR] no example target named `foo`.
+
+",
+        )
         .run();
     p.cargo("run --bin foo")
         .with_status(101)
-        .with_stderr("[ERROR] no bin target named `foo`")
+        .with_stderr(
+            "\
+[ERROR] no bin target named `foo`.
+
+",
+        )
         .run();
 }