@@ -250,3 +250,53 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html
250250"# ] ] )
251251 . run ( ) ;
252252}
253+
254+ #[ cargo_test]
255+ fn env_paths_overrides_not_supported ( ) {
256+ Package :: new ( "file" , "0.1.0" ) . publish ( ) ;
257+ Package :: new ( "cli" , "0.1.0" ) . publish ( ) ;
258+ Package :: new ( "env" , "0.1.0" ) . publish ( ) ;
259+
260+ let p = project ( )
261+ . file (
262+ "Cargo.toml" ,
263+ r#"
264+ [package]
265+ name = "foo"
266+ edition = "2015"
267+
268+ [dependencies]
269+ file = "0.1.0"
270+ cli = "0.1.0"
271+ env = "0.1.0"
272+ "# ,
273+ )
274+ . file ( "src/lib.rs" , "" )
275+ . file ( "file/Cargo.toml" , & basic_manifest ( "file" , "0.2.0" ) )
276+ . file ( "file/src/lib.rs" , "" )
277+ . file ( "cli/Cargo.toml" , & basic_manifest ( "cli" , "0.2.0" ) )
278+ . file ( "cli/src/lib.rs" , "" )
279+ . file ( "env/Cargo.toml" , & basic_manifest ( "env" , "0.2.0" ) )
280+ . file ( "env/src/lib.rs" , "" )
281+ . file ( ".cargo/config.toml" , r#"paths = ["file"]"# )
282+ . build ( ) ;
283+
284+ p. cargo ( "check" )
285+ . arg ( "--config" )
286+ . arg ( "paths=['cli']" )
287+ // paths overrides ignore env
288+ . env ( "CARGO_PATHS" , "env" )
289+ . with_stderr_data ( str![ [ r#"
290+ [UPDATING] `dummy-registry` index
291+ [LOCKING] 3 packages to latest compatible versions
292+ [DOWNLOADING] crates ...
293+ [DOWNLOADED] env v0.1.0 (registry `dummy-registry`)
294+ [CHECKING] file v0.2.0 ([ROOT]/foo/file)
295+ [CHECKING] cli v0.2.0 ([ROOT]/foo/cli)
296+ [CHECKING] env v0.1.0
297+ [CHECKING] foo v0.0.0 ([ROOT]/foo)
298+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
299+
300+ "# ] ] )
301+ . run ( ) ;
302+ }
0 commit comments