File tree Expand file tree Collapse file tree 2 files changed +64
-1
lines changed Expand file tree Collapse file tree 2 files changed +64
-1
lines changed Original file line number Diff line number Diff line change @@ -1035,7 +1035,7 @@ impl TomlManifest {
1035
1035
features. require ( Feature :: publish_lockfile ( ) ) ?;
1036
1036
b
1037
1037
}
1038
- None => false ,
1038
+ None => features . is_enabled ( Feature :: publish_lockfile ( ) ) ,
1039
1039
} ;
1040
1040
1041
1041
if summary. features ( ) . contains_key ( "default-features" ) {
Original file line number Diff line number Diff line change @@ -414,3 +414,66 @@ dependencies = [
414
414
)
415
415
. run ( ) ;
416
416
}
417
+
418
+ #[ test]
419
+ fn publish_lockfile_default ( ) {
420
+ let p = project ( )
421
+ . file (
422
+ "Cargo.toml" ,
423
+ r#"
424
+ cargo-features = ["publish-lockfile"]
425
+ [package]
426
+ name = "foo"
427
+ version = "1.0.0"
428
+ authors = []
429
+ license = "MIT"
430
+ description = "foo"
431
+ documentation = "foo"
432
+ homepage = "foo"
433
+ repository = "foo"
434
+ "# ,
435
+ )
436
+ . file ( "src/main.rs" , "fn main() {}" )
437
+ . build ( ) ;
438
+
439
+ p. cargo ( "package -l" )
440
+ . masquerade_as_nightly_cargo ( )
441
+ . with_stdout (
442
+ "\
443
+ Cargo.lock
444
+ Cargo.toml
445
+ src/main.rs
446
+ " ,
447
+ )
448
+ . run ( ) ;
449
+
450
+ let p = project ( )
451
+ . file (
452
+ "Cargo.toml" ,
453
+ r#"
454
+ cargo-features = ["publish-lockfile"]
455
+ [package]
456
+ name = "foo"
457
+ version = "1.0.0"
458
+ authors = []
459
+ license = "MIT"
460
+ description = "foo"
461
+ documentation = "foo"
462
+ homepage = "foo"
463
+ repository = "foo"
464
+ publish-lockfile = false
465
+ "# ,
466
+ )
467
+ . file ( "src/main.rs" , "fn main() {}" )
468
+ . build ( ) ;
469
+
470
+ p. cargo ( "package -l" )
471
+ . masquerade_as_nightly_cargo ( )
472
+ . with_stdout (
473
+ "\
474
+ Cargo.toml
475
+ src/main.rs
476
+ " ,
477
+ )
478
+ . run ( ) ;
479
+ }
You can’t perform that action at this time.
0 commit comments