1
+ #[ macro_use]
1
2
extern crate cargotest;
2
3
extern crate hamcrest;
3
4
@@ -19,8 +20,8 @@ fn is_feature_gated() {
19
20
version = "0.0.1"
20
21
registry = "alternative"
21
22
"# )
22
- . file ( "src/main.rs" , "fn main() {}" ) ;
23
- p . build ( ) ;
23
+ . file ( "src/main.rs" , "fn main() {}" )
24
+ . build ( ) ;
24
25
25
26
Package :: new ( "bar" , "0.0.1" ) . alternative ( true ) . publish ( ) ;
26
27
@@ -44,8 +45,8 @@ fn depend_on_alt_registry() {
44
45
version = "0.0.1"
45
46
registry = "alternative"
46
47
"# )
47
- . file ( "src/main.rs" , "fn main() {}" ) ;
48
- p . build ( ) ;
48
+ . file ( "src/main.rs" , "fn main() {}" )
49
+ . build ( ) ;
49
50
50
51
Package :: new ( "bar" , "0.0.1" ) . alternative ( true ) . publish ( ) ;
51
52
@@ -87,11 +88,11 @@ fn depend_on_alt_registry_depends_on_same_registry() {
87
88
version = "0.0.1"
88
89
registry = "alternative"
89
90
"# )
90
- . file ( "src/main.rs" , "fn main() {}" ) ;
91
- p . build ( ) ;
91
+ . file ( "src/main.rs" , "fn main() {}" )
92
+ . build ( ) ;
92
93
93
94
Package :: new ( "baz" , "0.0.1" ) . alternative ( true ) . publish ( ) ;
94
- Package :: new ( "bar" , "0.0.1" ) . dep ( "baz" , "0.0.1" ) . alternative ( true ) . publish ( ) ;
95
+ Package :: new ( "bar" , "0.0.1" ) . registry_dep ( "baz" , "0.0.1" , registry :: alt_registry ( ) . as_str ( ) ) . alternative ( true ) . publish ( ) ;
95
96
96
97
assert_that ( p. cargo ( "build" ) . masquerade_as_nightly_cargo ( ) ,
97
98
execs ( ) . with_status ( 0 ) . with_stderr ( & format ! ( "\
@@ -123,24 +124,26 @@ fn depend_on_alt_registry_depends_on_crates_io() {
123
124
version = "0.0.1"
124
125
registry = "alternative"
125
126
"# )
126
- . file ( "src/main.rs" , "fn main() {}" ) ;
127
- p . build ( ) ;
127
+ . file ( "src/main.rs" , "fn main() {}" )
128
+ . build ( ) ;
128
129
129
130
Package :: new ( "baz" , "0.0.1" ) . publish ( ) ;
130
- Package :: new ( "bar" , "0.0.1" ) . dep ( "baz" , "0.0.1" ) . alternative ( true ) . publish ( ) ;
131
+ Package :: new ( "bar" , "0.0.1" ) . registry_dep ( "baz" , "0.0.1" , registry :: registry ( ) . as_str ( ) ) . alternative ( true ) . publish ( ) ;
131
132
132
133
assert_that ( p. cargo ( "build" ) . masquerade_as_nightly_cargo ( ) ,
133
134
execs ( ) . with_status ( 0 ) . with_stderr ( & format ! ( "\
135
+ [UPDATING] registry `{alt_reg}`
134
136
[UPDATING] registry `{reg}`
135
137
[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
136
138
[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
137
- [COMPILING] baz v0.0.1
138
- [COMPILING] bar v0.0.1
139
+ [COMPILING] baz v0.0.1 (registry `file://[..]`)
140
+ [COMPILING] bar v0.0.1 (registry `file://[..]`)
139
141
[COMPILING] foo v0.0.1 ({dir})
140
142
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
141
143
" ,
142
144
dir = p. url( ) ,
143
- reg = registry:: alt_registry( ) ) ) ) ;
145
+ alt_reg = registry:: alt_registry( ) ,
146
+ reg = registry:: registry( ) ) ) ) ;
144
147
}
145
148
146
149
#[ test]
@@ -158,8 +161,8 @@ fn registry_incompatible_with_path() {
158
161
path = ""
159
162
registry = "alternative"
160
163
"# )
161
- . file ( "src/main.rs" , "fn main() {}" ) ;
162
- p . build ( ) ;
164
+ . file ( "src/main.rs" , "fn main() {}" )
165
+ . build ( ) ;
163
166
164
167
assert_that ( p. cargo ( "build" ) . masquerade_as_nightly_cargo ( ) ,
165
168
execs ( ) . with_status ( 101 )
@@ -181,8 +184,8 @@ fn registry_incompatible_with_git() {
181
184
git = ""
182
185
registry = "alternative"
183
186
"# )
184
- . file ( "src/main.rs" , "fn main() {}" ) ;
185
- p . build ( ) ;
187
+ . file ( "src/main.rs" , "fn main() {}" )
188
+ . build ( ) ;
186
189
187
190
assert_that ( p. cargo ( "build" ) . masquerade_as_nightly_cargo ( ) ,
188
191
execs ( ) . with_status ( 101 )
@@ -204,8 +207,8 @@ fn cannot_publish_with_registry_dependency() {
204
207
version = "0.0.1"
205
208
registry = "alternative"
206
209
"# )
207
- . file ( "src/main.rs" , "fn main() {}" ) ;
208
- p . build ( ) ;
210
+ . file ( "src/main.rs" , "fn main() {}" )
211
+ . build ( ) ;
209
212
210
213
Package :: new ( "bar" , "0.0.1" ) . alternative ( true ) . publish ( ) ;
211
214
@@ -233,8 +236,8 @@ fn alt_registry_and_crates_io_deps() {
233
236
version = "0.1.0"
234
237
registry = "alternative"
235
238
"# )
236
- . file ( "src/main.rs" , "fn main() {}" ) ;
237
- p . build ( ) ;
239
+ . file ( "src/main.rs" , "fn main() {}" )
240
+ . build ( ) ;
238
241
239
242
Package :: new ( "crates_io_dep" , "0.0.1" ) . publish ( ) ;
240
243
Package :: new ( "alt_reg_dep" , "0.1.0" ) . alternative ( true ) . publish ( ) ;
@@ -259,77 +262,3 @@ fn alt_registry_and_crates_io_deps() {
259
262
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs") )
260
263
261
264
}
262
-
263
- #[ test]
264
- fn alt_registry_dep_with_crates_io_dep ( ) {
265
-
266
- let p = project ( "foo" )
267
- . file ( "Cargo.toml" , r#"
268
- cargo-features = ["alternative-registries"]
269
-
270
- [project]
271
- name = "foo"
272
- version = "0.0.1"
273
- authors = []
274
-
275
- [dependencies.alt_reg_dep]
276
- version = "0.1.1"
277
- registry = "alternative"
278
- "# )
279
- . file ( "src/main.rs" , "fn main() {}" ) ;
280
- p. build ( ) ;
281
-
282
- Package :: new ( "crates_io_dep" , "0.0.2" ) . publish ( ) ;
283
- Package :: new ( "alt_reg_dep" , "0.1.1" ) . alternative ( true ) . registry_dep ( "crates_io_dep" , "0.0.2" , registry:: registry ( ) . as_str ( ) ) . publish ( ) ;
284
-
285
- assert_that ( p. cargo ( "build" ) . masquerade_as_nightly_cargo ( ) ,
286
- execs ( ) . with_status ( 0 ) . with_stderr ( & format ! ( "\
287
- [UPDATING] registry `{alt_reg}`
288
- [UPDATING] registry `{crates_io_reg}`
289
- [DOWNLOADING] alt_reg_dep v0.1.1 (registry `file://[..]`)
290
- [DOWNLOADING] crates_io_dep v0.0.2 (registry `file://[..]`)
291
- [COMPILING] crates_io_dep v0.0.2 (registry `file://[..]`)
292
- [COMPILING] alt_reg_dep v0.1.1 (registry `file://[..]`)
293
- [COMPILING] foo v0.0.1 ({dir})
294
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
295
- " ,
296
- dir = p. url( ) ,
297
- crates_io_reg = registry:: registry( ) ,
298
- alt_reg = registry:: alt_registry( ) ) ) ) ;
299
- }
300
-
301
- #[ test]
302
- fn alt_reg_dep_with_alt_reg_dep ( ) {
303
-
304
- let p = project ( "foo" )
305
- . file ( "Cargo.toml" , r#"
306
- cargo-features = ["alternative-registries"]
307
-
308
- [project]
309
- name = "foo"
310
- version = "0.0.1"
311
- authors = []
312
-
313
- [dependencies.bar]
314
- version = "0.1.1"
315
- registry = "alternative"
316
- "# )
317
- . file ( "src/main.rs" , "fn main() {}" ) ;
318
- p. build ( ) ;
319
-
320
- Package :: new ( "baz" , "0.0.2" ) . alternative ( true ) . publish ( ) ;
321
- Package :: new ( "bar" , "0.1.1" ) . alternative ( true ) . registry_dep ( "baz" , "0.0.2" , registry:: alt_registry ( ) . as_str ( ) ) . publish ( ) ;
322
-
323
- assert_that ( p. cargo ( "build" ) . masquerade_as_nightly_cargo ( ) ,
324
- execs ( ) . with_status ( 0 ) . with_stderr ( & format ! ( "\
325
- [UPDATING] registry `{alt_reg}`
326
- [DOWNLOADING] bar v0.1.1 (registry `file://[..]`)
327
- [DOWNLOADING] baz v0.0.2 (registry `file://[..]`)
328
- [COMPILING] baz v0.0.2 (registry `file://[..]`)
329
- [COMPILING] bar v0.1.1 (registry `file://[..]`)
330
- [COMPILING] foo v0.0.1 ({dir})
331
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
332
- " ,
333
- dir = p. url( ) ,
334
- alt_reg = registry:: alt_registry( ) ) ) ) ;
335
- }
0 commit comments