File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -1370,3 +1370,40 @@ fn update_precise_git_revisions() {
1370
1370
assert ! ( p. read_lockfile( ) . contains( & head_id) ) ;
1371
1371
assert ! ( !p. read_lockfile( ) . contains( & tag_commit_id) ) ;
1372
1372
}
1373
+
1374
+ #[ cargo_test]
1375
+ fn precise_yanked ( ) {
1376
+ Package :: new ( "bar" , "0.1.0" ) . publish ( ) ;
1377
+ Package :: new ( "bar" , "0.1.1" ) . yanked ( true ) . publish ( ) ;
1378
+ let p = project ( )
1379
+ . file (
1380
+ "Cargo.toml" ,
1381
+ r#"
1382
+ [package]
1383
+ name = "foo"
1384
+
1385
+ [dependencies]
1386
+ bar = "0.1"
1387
+ "# ,
1388
+ )
1389
+ . file ( "src/lib.rs" , "" )
1390
+ . build ( ) ;
1391
+
1392
+ p. cargo ( "generate-lockfile" ) . run ( ) ;
1393
+
1394
+ // Use non-yanked version.
1395
+ let lockfile = p. read_lockfile ( ) ;
1396
+ assert ! ( lockfile. contains( "\n name = \" bar\" \n version = \" 0.1.0\" " ) ) ;
1397
+
1398
+ p. cargo ( "update --precise 0.1.1 bar" )
1399
+ . with_status ( 101 )
1400
+ . with_stderr (
1401
+ "\
1402
+ [UPDATING] `dummy-registry` index
1403
+ [ERROR] no matching package named `bar` found
1404
+ location searched: registry `crates-io`
1405
+ required by package `foo v0.0.0 ([CWD])`
1406
+ " ,
1407
+ )
1408
+ . run ( )
1409
+ }
You can’t perform that action at this time.
0 commit comments