1
1
//! Tests for packages/target filter flags giving suggestions on which
2
2
//! packages/targets are available.
3
3
4
- #![ allow( deprecated) ]
5
-
6
4
use cargo_test_support:: prelude:: * ;
7
5
use cargo_test_support:: project;
8
6
@@ -28,9 +26,9 @@ fn list_availables_test(command: &str, targets: u8) {
28
26
if targets & EXAMPLE != 0 {
29
27
full_project
30
28
. cargo ( & format ! ( "{} --example" , command) )
31
- . with_stderr (
29
+ . with_stderr_data (
32
30
"\
33
- error: \" --example\" takes one argument.
31
+ [ERROR] \" --example\" takes one argument.
34
32
Available examples:
35
33
a
36
34
b
@@ -44,9 +42,9 @@ Available examples:
44
42
if targets & BIN != 0 {
45
43
full_project
46
44
. cargo ( & format ! ( "{} --bin" , command) )
47
- . with_stderr (
45
+ . with_stderr_data (
48
46
"\
49
- error: \" --bin\" takes one argument.
47
+ [ERROR] \" --bin\" takes one argument.
50
48
Available binaries:
51
49
foo
52
50
@@ -59,9 +57,9 @@ Available binaries:
59
57
if targets & BENCH != 0 {
60
58
full_project
61
59
. cargo ( & format ! ( "{} --bench" , command) )
62
- . with_stderr (
60
+ . with_stderr_data (
63
61
"\
64
- error: \" --bench\" takes one argument.
62
+ [ERROR] \" --bench\" takes one argument.
65
63
Available bench targets:
66
64
bench1
67
65
bench2
@@ -75,9 +73,9 @@ Available bench targets:
75
73
if targets & TEST != 0 {
76
74
full_project
77
75
. cargo ( & format ! ( "{} --test" , command) )
78
- . with_stderr (
76
+ . with_stderr_data (
79
77
"\
80
- error: \" --test\" takes one argument.
78
+ [ERROR] \" --test\" takes one argument.
81
79
Available test targets:
82
80
test1
83
81
test2
@@ -91,7 +89,7 @@ Available test targets:
91
89
if targets & PACKAGE != 0 {
92
90
full_project
93
91
. cargo ( & format ! ( "{} -p" , command) )
94
- . with_stderr (
92
+ . with_stderr_data (
95
93
"\
96
94
[ERROR] \" --package <SPEC>\" requires a SPEC format value, \
97
95
which can be any package ID specifier in the dependency graph.
@@ -111,9 +109,9 @@ Possible packages/workspace members:
111
109
if targets & EXAMPLE != 0 {
112
110
empty_project
113
111
. cargo ( & format ! ( "{} --example" , command) )
114
- . with_stderr (
112
+ . with_stderr_data (
115
113
"\
116
- error: \" --example\" takes one argument.
114
+ [ERROR] \" --example\" takes one argument.
117
115
No examples available.
118
116
119
117
" ,
@@ -125,9 +123,9 @@ No examples available.
125
123
if targets & BIN != 0 {
126
124
empty_project
127
125
. cargo ( & format ! ( "{} --bin" , command) )
128
- . with_stderr (
126
+ . with_stderr_data (
129
127
"\
130
- error: \" --bin\" takes one argument.
128
+ [ERROR] \" --bin\" takes one argument.
131
129
No binaries available.
132
130
133
131
" ,
@@ -139,9 +137,9 @@ No binaries available.
139
137
if targets & BENCH != 0 {
140
138
empty_project
141
139
. cargo ( & format ! ( "{} --bench" , command) )
142
- . with_stderr (
140
+ . with_stderr_data (
143
141
"\
144
- error: \" --bench\" takes one argument.
142
+ [ERROR] \" --bench\" takes one argument.
145
143
No bench targets available.
146
144
147
145
" ,
@@ -153,9 +151,9 @@ No bench targets available.
153
151
if targets & TEST != 0 {
154
152
empty_project
155
153
. cargo ( & format ! ( "{} --test" , command) )
156
- . with_stderr (
154
+ . with_stderr_data (
157
155
"\
158
- error: \" --test\" takes one argument.
156
+ [ERROR] \" --test\" takes one argument.
159
157
No test targets available.
160
158
161
159
" ,
@@ -167,9 +165,9 @@ No test targets available.
167
165
if targets & TARGET != 0 {
168
166
empty_project
169
167
. cargo ( & format ! ( "{} --target" , command) )
170
- . with_stderr (
168
+ . with_stderr_data (
171
169
"\
172
- error: \" --target\" takes a target architecture as an argument.
170
+ [ERROR] \" --target\" takes a target architecture as an argument.
173
171
174
172
Run `[..]` to see possible targets.
175
173
" ,
0 commit comments