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