File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -294,3 +294,46 @@ fn source_replacement_with_registry_url() {
294
294
"# ] ] )
295
295
. run ( ) ;
296
296
}
297
+
298
+ #[ cargo_test]
299
+ fn source_replacement_with_no_package_in_directoy ( ) {
300
+ let p = project ( )
301
+ . file (
302
+ "Cargo.toml" ,
303
+ r#"
304
+ [package]
305
+ name = "foo"
306
+ version = "0.1.0"
307
+ edition = "2021"
308
+
309
+ [dependencies]
310
+ bar = { version = "^0.8.9" }
311
+ "# ,
312
+ )
313
+ . file ( "src/lib.rs" , "" )
314
+ . build ( ) ;
315
+
316
+ let root = paths:: root ( ) ;
317
+ t ! ( fs:: create_dir( & root. join( "vendor" ) ) ) ;
318
+
319
+ let crates_io = setup_replacement ( & format ! (
320
+ r#"
321
+ [source.crates-io]
322
+ replace-with = "vendored-sources"
323
+
324
+ [source.vendored-sources]
325
+ directory = "vendor"
326
+ "#
327
+ ) ) ;
328
+
329
+ p. cargo ( "build" )
330
+ . replace_crates_io ( crates_io. index_url ( ) )
331
+ . with_status ( 101 )
332
+ . with_stderr_data ( str![ [ r#"
333
+ [ERROR] no matching package named `bar` found
334
+ location searched: registry `crates-io`
335
+ required by package `foo v0.1.0 ([ROOT]/foo)`
336
+
337
+ "# ] ] )
338
+ . run ( ) ;
339
+ }
You can’t perform that action at this time.
0 commit comments