File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,50 @@ Caused by:
315315 . run ( ) ;
316316}
317317
318+ #[ cargo_test]
319+ fn registry_index_allowed_in_registry_packages ( ) {
320+ registry:: alt_init ( ) ;
321+
322+ Package :: new ( "base" , "0.1.0" ) . alternative ( true ) . publish ( ) ;
323+
324+ Package :: new ( "intermediate" , "0.1.0" )
325+ . alternative ( true )
326+ . registry_dep ( "base" , "0.1.0" )
327+ . publish ( ) ;
328+
329+ let p = project ( )
330+ . file (
331+ "Cargo.toml" ,
332+ r#"
333+ [package]
334+ name = "foo"
335+ version = "0.0.1"
336+ edition = "2015"
337+ authors = []
338+
339+ [dependencies]
340+ intermediate = { version = "0.1.0", registry = "alternative" }
341+ "# ,
342+ )
343+ . file ( "src/lib.rs" , "" )
344+ . build ( ) ;
345+
346+ p. cargo ( "check" )
347+ . with_stderr_data ( str![ [ r#"
348+ [UPDATING] `alternative` index
349+ [LOCKING] 2 packages to latest compatible versions
350+ [DOWNLOADING] crates ...
351+ [DOWNLOADED] intermediate v0.1.0 (registry `alternative`)
352+ [DOWNLOADED] base v0.1.0 (registry `alternative`)
353+ [CHECKING] base v0.1.0 (registry `alternative`)
354+ [CHECKING] intermediate v0.1.0 (registry `alternative`)
355+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
356+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
357+
358+ "# ] ] )
359+ . run ( ) ;
360+ }
361+
318362#[ cargo_test]
319363fn cannot_publish_to_crates_io_with_registry_dependency ( ) {
320364 let crates_io = registry:: init ( ) ;
You can’t perform that action at this time.
0 commit comments