File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -1939,3 +1939,44 @@ fn vendor_crate_with_ws_inherit() {
1939
1939
"# ] ] )
1940
1940
. run ( ) ;
1941
1941
}
1942
+
1943
+ #[ cargo_test]
1944
+ fn dont_delete_non_registry_sources_with_respect_source_config ( ) {
1945
+ let p = project ( )
1946
+ . file (
1947
+ "Cargo.toml" ,
1948
+ r#"
1949
+ [package]
1950
+ name = "foo"
1951
+ version = "0.1.0"
1952
+
1953
+ [dependencies]
1954
+ log = "0.3.5"
1955
+ "# ,
1956
+ )
1957
+ . file ( "src/lib.rs" , "" )
1958
+ . build ( ) ;
1959
+
1960
+ Package :: new ( "log" , "0.3.5" ) . publish ( ) ;
1961
+
1962
+ p. cargo ( "vendor --respect-source-config" ) . run ( ) ;
1963
+ let lock = p. read_file ( "vendor/log/Cargo.toml" ) ;
1964
+ assert ! ( lock. contains( "version = \" 0.3.5\" " ) ) ;
1965
+
1966
+ add_crates_io_vendor_config ( & p) ;
1967
+ p. cargo ( "vendor --respect-source-config new-vendor-dir" )
1968
+ . with_status ( 101 )
1969
+ . with_stderr_data ( str![ [ r#"
1970
+ [ERROR] failed to sync
1971
+
1972
+ Caused by:
1973
+ failed to load pkg lockfile
1974
+
1975
+ Caused by:
1976
+ no matching package named `log` found
1977
+ location searched: directory source `[ROOT]/foo/vendor` (which is replacing registry `crates-io`)
1978
+ required by package `foo v0.1.0 ([ROOT]/foo)`
1979
+
1980
+ "# ] ] )
1981
+ . run ( ) ;
1982
+ }
You can’t perform that action at this time.
0 commit comments