@@ -2564,6 +2564,68 @@ perhaps a crate was updated and forgotten to be re-vendored?
2564
2564
. run ( ) ;
2565
2565
}
2566
2566
2567
+ #[ cargo_test]
2568
+ fn update_precise_breaking_direct_plus_transitive ( ) {
2569
+ Package :: new ( "incompatible" , "1.0.0" ) . publish ( ) ;
2570
+
2571
+ let p = project ( )
2572
+ . file (
2573
+ "Cargo.toml" ,
2574
+ r#"
2575
+ # Check if formatting is preserved
2576
+
2577
+ [package]
2578
+ name = "foo"
2579
+ version = "0.0.1"
2580
+ edition = "2015"
2581
+ authors = []
2582
+
2583
+ [dependencies]
2584
+ incompatible = "1.0" # Comment
2585
+ bar = { path = "bar" }
2586
+ "# ,
2587
+ )
2588
+ . file ( "src/lib.rs" , "" )
2589
+ . file (
2590
+ "bar/Cargo.toml" ,
2591
+ r#"
2592
+ [package]
2593
+ name = "bar"
2594
+ version = "0.0.1"
2595
+ edition = "2015"
2596
+ authors = []
2597
+
2598
+ [dependencies]
2599
+ incompatible = "1.0"
2600
+ "# ,
2601
+ )
2602
+ . file ( "bar/src/lib.rs" , "" )
2603
+ . build ( ) ;
2604
+
2605
+ p. cargo ( "generate-lockfile" ) . run ( ) ;
2606
+ let lock1 = p. read_lockfile ( ) ;
2607
+
2608
+ Package :: new ( "incompatible" , "2.0.0" ) . publish ( ) ;
2609
+ Package :: new ( "incompatible" , "2.0.1" ) . publish ( ) ;
2610
+
2611
+ p. cargo ( "update -Zunstable-options incompatible --precise 2.0.0" )
2612
+ . masquerade_as_nightly_cargo ( & [ "update-precise-breaking" ] )
2613
+ . with_stderr_data ( str![ [ r#"
2614
+ [UPGRADING] incompatible ^1.0 -> ^2.0
2615
+ [UPDATING] `dummy-registry` index
2616
+ [ADDING] incompatible v2.0.0 (latest: v2.0.1)
2617
+ [NOTE] pass `--verbose` to see 1 unchanged dependencies behind latest
2618
+
2619
+ "# ] ] )
2620
+ . run ( ) ;
2621
+
2622
+ let lock2 = p. read_lockfile ( ) ;
2623
+
2624
+ assert_ne ! ( lock1, lock2) ;
2625
+ assert ! ( lock2. contains( "incompatible 1.0.0" ) ) ;
2626
+ assert ! ( lock2. contains( "incompatible 2.0.0" ) ) ;
2627
+ }
2628
+
2567
2629
#[ cargo_test]
2568
2630
fn update_precise_breaking_incompatible_downgrade ( ) {
2569
2631
Package :: new ( "incompatible" , "1.0.0" ) . publish ( ) ;
0 commit comments