Skip to content

Commit 3068b62

Browse files
committed
test: migrate list_availables to snapbox
1 parent 47a3154 commit 3068b62

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

tests/testsuite/list_availables.rs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Tests for packages/target filter flags giving suggestions on which
22
//! packages/targets are available.
33
4-
#![allow(deprecated)]
5-
64
use cargo_test_support::project;
75

86
const EXAMPLE: u8 = 1 << 0;
@@ -27,9 +25,9 @@ fn list_availables_test(command: &str, targets: u8) {
2725
if targets & EXAMPLE != 0 {
2826
full_project
2927
.cargo(&format!("{} --example", command))
30-
.with_stderr(
28+
.with_stderr_data(
3129
"\
32-
error: \"--example\" takes one argument.
30+
[ERROR] \"--example\" takes one argument.
3331
Available examples:
3432
a
3533
b
@@ -43,9 +41,9 @@ Available examples:
4341
if targets & BIN != 0 {
4442
full_project
4543
.cargo(&format!("{} --bin", command))
46-
.with_stderr(
44+
.with_stderr_data(
4745
"\
48-
error: \"--bin\" takes one argument.
46+
[ERROR] \"--bin\" takes one argument.
4947
Available binaries:
5048
foo
5149
@@ -58,9 +56,9 @@ Available binaries:
5856
if targets & BENCH != 0 {
5957
full_project
6058
.cargo(&format!("{} --bench", command))
61-
.with_stderr(
59+
.with_stderr_data(
6260
"\
63-
error: \"--bench\" takes one argument.
61+
[ERROR] \"--bench\" takes one argument.
6462
Available bench targets:
6563
bench1
6664
bench2
@@ -74,9 +72,9 @@ Available bench targets:
7472
if targets & TEST != 0 {
7573
full_project
7674
.cargo(&format!("{} --test", command))
77-
.with_stderr(
75+
.with_stderr_data(
7876
"\
79-
error: \"--test\" takes one argument.
77+
[ERROR] \"--test\" takes one argument.
8078
Available test targets:
8179
test1
8280
test2
@@ -90,7 +88,7 @@ Available test targets:
9088
if targets & PACKAGE != 0 {
9189
full_project
9290
.cargo(&format!("{} -p", command))
93-
.with_stderr(
91+
.with_stderr_data(
9492
"\
9593
[ERROR] \"--package <SPEC>\" requires a SPEC format value, \
9694
which can be any package ID specifier in the dependency graph.
@@ -110,9 +108,9 @@ Possible packages/workspace members:
110108
if targets & EXAMPLE != 0 {
111109
empty_project
112110
.cargo(&format!("{} --example", command))
113-
.with_stderr(
111+
.with_stderr_data(
114112
"\
115-
error: \"--example\" takes one argument.
113+
[ERROR] \"--example\" takes one argument.
116114
No examples available.
117115
118116
",
@@ -124,9 +122,9 @@ No examples available.
124122
if targets & BIN != 0 {
125123
empty_project
126124
.cargo(&format!("{} --bin", command))
127-
.with_stderr(
125+
.with_stderr_data(
128126
"\
129-
error: \"--bin\" takes one argument.
127+
[ERROR] \"--bin\" takes one argument.
130128
No binaries available.
131129
132130
",
@@ -138,9 +136,9 @@ No binaries available.
138136
if targets & BENCH != 0 {
139137
empty_project
140138
.cargo(&format!("{} --bench", command))
141-
.with_stderr(
139+
.with_stderr_data(
142140
"\
143-
error: \"--bench\" takes one argument.
141+
[ERROR] \"--bench\" takes one argument.
144142
No bench targets available.
145143
146144
",
@@ -152,9 +150,9 @@ No bench targets available.
152150
if targets & TEST != 0 {
153151
empty_project
154152
.cargo(&format!("{} --test", command))
155-
.with_stderr(
153+
.with_stderr_data(
156154
"\
157-
error: \"--test\" takes one argument.
155+
[ERROR] \"--test\" takes one argument.
158156
No test targets available.
159157
160158
",
@@ -166,9 +164,9 @@ No test targets available.
166164
if targets & TARGET != 0 {
167165
empty_project
168166
.cargo(&format!("{} --target", command))
169-
.with_stderr(
167+
.with_stderr_data(
170168
"\
171-
error: \"--target\" takes a target architecture as an argument.
169+
[ERROR] \"--target\" takes a target architecture as an argument.
172170
173171
Run `[..]` to see possible targets.
174172
",

0 commit comments

Comments
 (0)