@@ -2643,6 +2643,79 @@ a = {path = "a", default-features = false}
2643
2643
) ;
2644
2644
}
2645
2645
2646
+ #[ cargo_test]
2647
+ fn migrate_rename_underscore_fields_in_virtual_manifest ( ) {
2648
+ let p = project ( )
2649
+ . file (
2650
+ "Cargo.toml" ,
2651
+ r#"
2652
+ [workspace]
2653
+ members = ["foo"]
2654
+ resolver = "2"
2655
+
2656
+ [workspace.dependencies]
2657
+ # Before default_features
2658
+ a = {path = "a", default_features = false} # After default_features value
2659
+ # After default_features line
2660
+ "# ,
2661
+ )
2662
+ . file (
2663
+ "foo/Cargo.toml" ,
2664
+ r#"
2665
+ [package]
2666
+ name = "foo"
2667
+ edition = "2021"
2668
+ "# ,
2669
+ )
2670
+ . file ( "foo/src/lib.rs" , "" )
2671
+ . file (
2672
+ "a/Cargo.toml" ,
2673
+ r#"
2674
+ [package]
2675
+ name = "a"
2676
+ version = "0.0.1"
2677
+ edition = "2015"
2678
+ "# ,
2679
+ )
2680
+ . file ( "a/src/lib.rs" , "" )
2681
+ . build ( ) ;
2682
+
2683
+ p. cargo ( "fix --edition --allow-no-vcs" )
2684
+ . with_stderr_data ( str![ [ r#"
2685
+ [MIGRATING] foo/Cargo.toml from 2021 edition to 2024
2686
+ [CHECKING] foo v0.0.0 ([ROOT]/foo/foo)
2687
+ [MIGRATING] foo/src/lib.rs from 2021 edition to 2024
2688
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
2689
+
2690
+ "# ] ] )
2691
+ . run ( ) ;
2692
+ assert_e2e ( ) . eq (
2693
+ p. read_file ( "Cargo.toml" ) ,
2694
+ str![ [ r#"
2695
+
2696
+ [workspace]
2697
+ members = ["foo"]
2698
+ resolver = "2"
2699
+
2700
+ [workspace.dependencies]
2701
+ # Before default_features
2702
+ a = {path = "a", default_features = false} # After default_features value
2703
+ # After default_features line
2704
+
2705
+ "# ] ] ,
2706
+ ) ;
2707
+ assert_e2e ( ) . eq (
2708
+ p. read_file ( "foo/Cargo.toml" ) ,
2709
+ str![ [ r#"
2710
+
2711
+ [package]
2712
+ name = "foo"
2713
+ edition = "2021"
2714
+
2715
+ "# ] ] ,
2716
+ ) ;
2717
+ }
2718
+
2646
2719
#[ cargo_test]
2647
2720
fn remove_ignored_default_features ( ) {
2648
2721
Package :: new ( "dep_simple" , "0.1.0" ) . publish ( ) ;
0 commit comments