Skip to content

Commit b43ea97

Browse files
committed
test: migrate list_availables to snapbox
1 parent 7a6bf16 commit b43ea97

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::prelude::*;
75
use cargo_test_support::project;
86

@@ -28,9 +26,9 @@ fn list_availables_test(command: &str, targets: u8) {
2826
if targets & EXAMPLE != 0 {
2927
full_project
3028
.cargo(&format!("{} --example", command))
31-
.with_stderr(
29+
.with_stderr_data(
3230
"\
33-
error: \"--example\" takes one argument.
31+
[ERROR] \"--example\" takes one argument.
3432
Available examples:
3533
a
3634
b
@@ -44,9 +42,9 @@ Available examples:
4442
if targets & BIN != 0 {
4543
full_project
4644
.cargo(&format!("{} --bin", command))
47-
.with_stderr(
45+
.with_stderr_data(
4846
"\
49-
error: \"--bin\" takes one argument.
47+
[ERROR] \"--bin\" takes one argument.
5048
Available binaries:
5149
foo
5250
@@ -59,9 +57,9 @@ Available binaries:
5957
if targets & BENCH != 0 {
6058
full_project
6159
.cargo(&format!("{} --bench", command))
62-
.with_stderr(
60+
.with_stderr_data(
6361
"\
64-
error: \"--bench\" takes one argument.
62+
[ERROR] \"--bench\" takes one argument.
6563
Available bench targets:
6664
bench1
6765
bench2
@@ -75,9 +73,9 @@ Available bench targets:
7573
if targets & TEST != 0 {
7674
full_project
7775
.cargo(&format!("{} --test", command))
78-
.with_stderr(
76+
.with_stderr_data(
7977
"\
80-
error: \"--test\" takes one argument.
78+
[ERROR] \"--test\" takes one argument.
8179
Available test targets:
8280
test1
8381
test2
@@ -91,7 +89,7 @@ Available test targets:
9189
if targets & PACKAGE != 0 {
9290
full_project
9391
.cargo(&format!("{} -p", command))
94-
.with_stderr(
92+
.with_stderr_data(
9593
"\
9694
[ERROR] \"--package <SPEC>\" requires a SPEC format value, \
9795
which can be any package ID specifier in the dependency graph.
@@ -111,9 +109,9 @@ Possible packages/workspace members:
111109
if targets & EXAMPLE != 0 {
112110
empty_project
113111
.cargo(&format!("{} --example", command))
114-
.with_stderr(
112+
.with_stderr_data(
115113
"\
116-
error: \"--example\" takes one argument.
114+
[ERROR] \"--example\" takes one argument.
117115
No examples available.
118116
119117
",
@@ -125,9 +123,9 @@ No examples available.
125123
if targets & BIN != 0 {
126124
empty_project
127125
.cargo(&format!("{} --bin", command))
128-
.with_stderr(
126+
.with_stderr_data(
129127
"\
130-
error: \"--bin\" takes one argument.
128+
[ERROR] \"--bin\" takes one argument.
131129
No binaries available.
132130
133131
",
@@ -139,9 +137,9 @@ No binaries available.
139137
if targets & BENCH != 0 {
140138
empty_project
141139
.cargo(&format!("{} --bench", command))
142-
.with_stderr(
140+
.with_stderr_data(
143141
"\
144-
error: \"--bench\" takes one argument.
142+
[ERROR] \"--bench\" takes one argument.
145143
No bench targets available.
146144
147145
",
@@ -153,9 +151,9 @@ No bench targets available.
153151
if targets & TEST != 0 {
154152
empty_project
155153
.cargo(&format!("{} --test", command))
156-
.with_stderr(
154+
.with_stderr_data(
157155
"\
158-
error: \"--test\" takes one argument.
156+
[ERROR] \"--test\" takes one argument.
159157
No test targets available.
160158
161159
",
@@ -167,9 +165,9 @@ No test targets available.
167165
if targets & TARGET != 0 {
168166
empty_project
169167
.cargo(&format!("{} --target", command))
170-
.with_stderr(
168+
.with_stderr_data(
171169
"\
172-
error: \"--target\" takes a target architecture as an argument.
170+
[ERROR] \"--target\" takes a target architecture as an argument.
173171
174172
Run `[..]` to see possible targets.
175173
",

0 commit comments

Comments
 (0)