Commit 3e3383a 1 parent 993a8da commit 3e3383a Copy full SHA for 3e3383a
File tree 1 file changed +33
-0
lines changed
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() {
1338
1338
. run ( ) ;
1339
1339
}
1340
1340
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#dep@1.0.0
1365
+
1366
+ "# ] ] )
1367
+ . with_stderr_data ( str![ [ r#"
1368
+ [WARNING] `package.edition` is unspecified, defaulting to `2024`
1369
+
1370
+ "# ] ] )
1371
+ . run ( ) ;
1372
+ }
1373
+
1341
1374
#[ cargo_test]
1342
1375
fn cmd_package_with_embedded ( ) {
1343
1376
let p = cargo_test_support:: project ( )
You can’t perform that action at this time.
0 commit comments