File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -1338,6 +1338,39 @@ fn cmd_pkgid_with_embedded_no_lock_file() {
13381338 . run ( ) ;
13391339}
13401340
1341+ #[ cargo_test]
1342+ fn cmd_pkgid_with_embedded_dep ( ) {
1343+ Package :: new ( "dep" , "1.0.0" ) . publish ( ) ;
1344+ let script = r#"#!/usr/bin/env cargo
1345+ ---
1346+ [dependencies]
1347+ dep = "1.0.0"
1348+ ---
1349+
1350+ fn main() {
1351+ println!("Hello world!");
1352+ }"# ;
1353+ let p = cargo_test_support:: project ( )
1354+ . file ( "script.rs" , script)
1355+ . build ( ) ;
1356+
1357+ p. cargo ( "-Zscript script.rs" )
1358+ . masquerade_as_nightly_cargo ( & [ "script" ] )
1359+ . run ( ) ;
1360+
1361+ p. cargo ( "-Zscript pkgid --manifest-path script.rs -p dep" )
1362+ . masquerade_as_nightly_cargo ( & [ "script" ] )
1363+ . with_stdout_data ( str![ [ r#"
1364+ registry+https://github.com/rust-lang/crates.io-index#[email protected] 1365+
1366+ "# ] ] )
1367+ . with_stderr_data ( str![ [ r#"
1368+ [WARNING] `package.edition` is unspecified, defaulting to `2024`
1369+
1370+ "# ] ] )
1371+ . run ( ) ;
1372+ }
1373+
13411374#[ cargo_test]
13421375fn cmd_package_with_embedded ( ) {
13431376 let p = cargo_test_support:: project ( )
You can’t perform that action at this time.
0 commit comments