File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -217,5 +217,10 @@ mod test {
217
217
assert_req_bump ( "1.1.1" , "=1.0.0" , "=1.1.1" ) ;
218
218
assert_req_bump ( "2.0.0" , "=1.0.0" , "=2.0.0" ) ;
219
219
}
220
+
221
+ #[ test]
222
+ fn caret_prerelease ( ) {
223
+ assert_req_bump ( "1.7.0" , "2.0.0-beta.21" , "1.7.0" ) ;
224
+ }
220
225
}
221
226
}
Original file line number Diff line number Diff line change @@ -2616,3 +2616,40 @@ fn update_breaking_mixed_pinning_renaming() {
2616
2616
"# ] ] ,
2617
2617
) ;
2618
2618
}
2619
+
2620
+ #[ cargo_test]
2621
+ fn update_breaking_pre_release ( ) {
2622
+ Package :: new ( "bar" , "2.0.0-beta.21" ) . publish ( ) ;
2623
+
2624
+ let p = project ( )
2625
+ . file (
2626
+ "Cargo.toml" ,
2627
+ r#"
2628
+ [package]
2629
+ name = "foo"
2630
+ version = "0.0.1"
2631
+ edition = "2015"
2632
+ authors = []
2633
+
2634
+ [dependencies]
2635
+ bar = "2.0.0-beta.21"
2636
+ "# ,
2637
+ )
2638
+ . file ( "src/lib.rs" , "" )
2639
+ . build ( ) ;
2640
+
2641
+ p. cargo ( "generate-lockfile" ) . run ( ) ;
2642
+
2643
+ Package :: new ( "bar" , "1.7.0" ) . publish ( ) ;
2644
+
2645
+ p. cargo ( "update -Zunstable-options --breaking bar" )
2646
+ . masquerade_as_nightly_cargo ( & [ "update-breaking" ] )
2647
+ . with_stderr_data ( str![ [ r#"
2648
+ [UPDATING] `dummy-registry` index
2649
+ [UPGRADING] bar ^2.0.0-beta.21 -> ^1.7.0
2650
+ [LOCKING] 1 package to latest compatible version
2651
+ [DOWNGRADING] bar v2.0.0-beta.21 -> v1.7.0
2652
+
2653
+ "# ] ] )
2654
+ . run ( ) ;
2655
+ }
You can’t perform that action at this time.
0 commit comments