Skip to content

Commit a968b12

Browse files
committed
Update old tests
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent a4d862d commit a968b12

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

tests/testsuite/build.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,14 @@ fn cargo_compile_with_filename() {
10411041

10421042
p.cargo("build --bin bin.rs")
10431043
.with_status(101)
1044-
.with_stderr("[ERROR] no bin target named `bin.rs`")
1044+
.with_stderr(
1045+
"\
1046+
[ERROR] no bin target named `bin.rs`.
1047+
Available bin targets:
1048+
a
1049+
1050+
",
1051+
)
10451052
.run();
10461053

10471054
p.cargo("build --bin a.rs")
@@ -1056,7 +1063,14 @@ fn cargo_compile_with_filename() {
10561063

10571064
p.cargo("build --example example.rs")
10581065
.with_status(101)
1059-
.with_stderr("[ERROR] no example target named `example.rs`")
1066+
.with_stderr(
1067+
"\
1068+
[ERROR] no example target named `example.rs`.
1069+
Available example targets:
1070+
a
1071+
1072+
",
1073+
)
10601074
.run();
10611075

10621076
p.cargo("build --example a.rs")

tests/testsuite/run.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,14 @@ fn run_with_filename() {
600600

601601
p.cargo("run --bin bin.rs")
602602
.with_status(101)
603-
.with_stderr("[ERROR] no bin target named `bin.rs`")
603+
.with_stderr(
604+
"\
605+
[ERROR] no bin target named `bin.rs`.
606+
Available bin targets:
607+
a
608+
609+
",
610+
)
604611
.run();
605612

606613
p.cargo("run --bin a.rs")
@@ -615,7 +622,14 @@ fn run_with_filename() {
615622

616623
p.cargo("run --example example.rs")
617624
.with_status(101)
618-
.with_stderr("[ERROR] no example target named `example.rs`")
625+
.with_stderr(
626+
"\
627+
[ERROR] no example target named `example.rs`.
628+
Available example targets:
629+
a
630+
631+
",
632+
)
619633
.run();
620634

621635
p.cargo("run --example a.rs")

tests/testsuite/test.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,11 +2122,21 @@ fn bad_example() {
21222122

21232123
p.cargo("run --example foo")
21242124
.with_status(101)
2125-
.with_stderr("[ERROR] no example target named `foo`")
2125+
.with_stderr(
2126+
"\
2127+
[ERROR] no example target named `foo`.
2128+
No example targets available.
2129+
2130+
")
21262131
.run();
21272132
p.cargo("run --bin foo")
21282133
.with_status(101)
2129-
.with_stderr("[ERROR] no bin target named `foo`")
2134+
.with_stderr(
2135+
"\
2136+
[ERROR] no bin target named `foo`.
2137+
No bin targets available.
2138+
2139+
")
21302140
.run();
21312141
}
21322142

0 commit comments

Comments
 (0)