File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1175,6 +1175,26 @@ fn v4_and_git_url_encoded_rev() {
1175
1175
#[ cargo_test]
1176
1176
fn with_msrv ( ) {
1177
1177
let cksum = Package :: new ( "bar" , "0.1.0" ) . publish ( ) ;
1178
+
1179
+ let v3_lockfile = format ! (
1180
+ r#"# This file is automatically @generated by Cargo.
1181
+ # It is not intended for manual editing.
1182
+ version = 3
1183
+
1184
+ [[package]]
1185
+ name = "bar"
1186
+ version = "0.1.0"
1187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1188
+ checksum = "{cksum}"
1189
+
1190
+ [[package]]
1191
+ name = "foo"
1192
+ version = "0.0.1"
1193
+ dependencies = [
1194
+ "bar",
1195
+ ]
1196
+ "#
1197
+ ) ;
1178
1198
let v2_lockfile = format ! (
1179
1199
r#"# This file is automatically @generated by Cargo.
1180
1200
# It is not intended for manual editing.
@@ -1258,6 +1278,14 @@ dependencies = [
1258
1278
( "1.53" , Some ( 4 ) , 4 ) ,
1259
1279
// v4 introduced
1260
1280
( "1.78" , None , 3 ) ,
1281
+ // last version of v3 as the default
1282
+ ( "1.82" , None , 3 ) ,
1283
+ // v4 is the default
1284
+ ( "1.83" , None , 3 ) ,
1285
+ ( "1.83" , Some ( 1 ) , 1 ) ,
1286
+ ( "1.83" , Some ( 2 ) , 2 ) ,
1287
+ ( "1.83" , Some ( 3 ) , 3 ) ,
1288
+ ( "1.83" , Some ( 4 ) , 4 ) ,
1261
1289
] ;
1262
1290
1263
1291
for ( msrv, existing_lockfile, expected_version) in cases {
@@ -1284,6 +1312,7 @@ dependencies = [
1284
1312
let existing_lockfile = match existing_lockfile {
1285
1313
1 => v1_lockfile. as_str ( ) . into ( ) ,
1286
1314
2 => v2_lockfile. as_str ( ) . into ( ) ,
1315
+ 3 => v3_lockfile. as_str ( ) . into ( ) ,
1287
1316
v => std:: borrow:: Cow :: from ( format ! ( "version = {v}" ) ) ,
1288
1317
} ;
1289
1318
p. change_file ( "Cargo.lock" , & existing_lockfile) ;
You can’t perform that action at this time.
0 commit comments