1
1
use crate :: support:: registry:: Package ;
2
- use crate :: support:: { project , is_nightly } ;
2
+ use crate :: support:: { is_nightly , project } ;
3
3
4
4
#[ test]
5
5
fn exported_priv_warning ( ) {
6
6
if !is_nightly ( ) {
7
7
return ;
8
8
}
9
9
Package :: new ( "priv_dep" , "0.1.0" )
10
- . file (
11
- "src/lib.rs" ,
12
- "pub struct FromPriv;"
13
- )
10
+ . file ( "src/lib.rs" , "pub struct FromPriv;" )
14
11
. publish ( ) ;
15
12
16
13
let p = project ( )
@@ -58,10 +55,7 @@ fn exported_pub_dep() {
58
55
return ;
59
56
}
60
57
Package :: new ( "pub_dep" , "0.1.0" )
61
- . file (
62
- "src/lib.rs" ,
63
- "pub struct FromPub;"
64
- )
58
+ . file ( "src/lib.rs" , "pub struct FromPub;" )
65
59
. publish ( ) ;
66
60
67
61
let p = project ( )
@@ -97,10 +91,9 @@ fn exported_pub_dep() {
97
91
[COMPILING] pub_dep v0.1.0
98
92
[COMPILING] foo v0.0.1 ([CWD])
99
93
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
100
- "
94
+ " ,
101
95
)
102
96
. run ( )
103
-
104
97
}
105
98
106
99
#[ test]
@@ -112,10 +105,7 @@ pub fn requires_nightly_cargo() {
112
105
cargo-features = ["public-dependency"]
113
106
"# ,
114
107
)
115
- . file (
116
- "src/lib.rs" ,
117
- ""
118
- )
108
+ . file ( "src/lib.rs" , "" )
119
109
. build ( ) ;
120
110
121
111
p. cargo ( "build --message-format=short" )
@@ -134,16 +124,10 @@ See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more inform
134
124
135
125
#[ test]
136
126
fn requires_feature ( ) {
137
-
138
-
139
127
Package :: new ( "pub_dep" , "0.1.0" )
140
- . file (
141
- "src/lib.rs" ,
142
- ""
143
- )
128
+ . file ( "src/lib.rs" , "" )
144
129
. publish ( ) ;
145
130
146
-
147
131
let p = project ( )
148
132
. file (
149
133
"Cargo.toml" ,
@@ -157,10 +141,7 @@ fn requires_feature() {
157
141
pub_dep = { version = "0.1.0", public = true }
158
142
"# ,
159
143
)
160
- . file (
161
- "src/lib.rs" ,
162
- ""
163
- )
144
+ . file ( "src/lib.rs" , "" )
164
145
. build ( ) ;
165
146
166
147
p. cargo ( "build --message-format=short" )
@@ -174,8 +155,7 @@ Caused by:
174
155
feature `public-dependency` is required
175
156
176
157
consider adding `cargo-features = [\" public-dependency\" ]` to the manifest
177
- "
158
+ " ,
178
159
)
179
160
. run ( )
180
-
181
161
}
0 commit comments