File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -735,6 +735,63 @@ fn transitive_new_major() {
735
735
. run ( ) ;
736
736
}
737
737
738
+ #[ cargo_test]
739
+ fn shared_by_transitive ( ) {
740
+ Package :: new ( "baz" , "0.1.1" ) . publish ( ) ;
741
+
742
+ let baz = git:: repo ( & paths:: root ( ) . join ( "override" ) )
743
+ . file ( "Cargo.toml" , & basic_manifest ( "baz" , "0.1.2" ) )
744
+ . file ( "src/lib.rs" , "" )
745
+ . build ( ) ;
746
+
747
+ let p = project ( )
748
+ . file (
749
+ "Cargo.toml" ,
750
+ & format ! (
751
+ r#"
752
+ [package]
753
+ name = "foo"
754
+ version = " 0.1.0"
755
+
756
+ [dependencies]
757
+ bar = {{ path = "bar" }}
758
+ baz = "0.1"
759
+
760
+ [patch.crates-io]
761
+ baz = {{ git = "{}", version = "0.1" }}
762
+ "# ,
763
+ baz. url( ) ,
764
+ ) ,
765
+ )
766
+ . file ( "src/lib.rs" , "" )
767
+ . file (
768
+ "bar/Cargo.toml" ,
769
+ r#"
770
+ [package]
771
+ name = "bar"
772
+ version = "0.1.0"
773
+
774
+ [dependencies]
775
+ baz = "0.1.1"
776
+ "# ,
777
+ )
778
+ . file ( "bar/src/lib.rs" , "" )
779
+ . build ( ) ;
780
+
781
+ p. cargo ( "build" )
782
+ . with_stderr (
783
+ "\
784
+ [UPDATING] git repository `file://[..]`
785
+ [UPDATING] `[ROOT][..]` index
786
+ [COMPILING] baz v0.1.2 [..]
787
+ [COMPILING] bar v0.1.0 [..]
788
+ [COMPILING] foo v0.1.0 ([CWD])
789
+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
790
+ " ,
791
+ )
792
+ . run ( ) ;
793
+ }
794
+
738
795
#[ cargo_test]
739
796
fn remove_patch ( ) {
740
797
Package :: new ( "foo" , "0.1.0" ) . publish ( ) ;
You can’t perform that action at this time.
0 commit comments