File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -2632,6 +2632,41 @@ fn ignores_unknown_index_version() {
2632
2632
. run ( ) ;
2633
2633
}
2634
2634
2635
+ #[ cargo_test]
2636
+ fn unknown_index_version_error ( ) {
2637
+ // If the version field is not understood, it is ignored.
2638
+ Package :: new ( "bar" , "1.0.1" )
2639
+ . schema_version ( u32:: MAX )
2640
+ . publish ( ) ;
2641
+
2642
+ let p = project ( )
2643
+ . file (
2644
+ "Cargo.toml" ,
2645
+ r#"
2646
+ [package]
2647
+ name = "foo"
2648
+ version = "0.1.0"
2649
+
2650
+ [dependencies]
2651
+ bar = "1.0"
2652
+ "# ,
2653
+ )
2654
+ . file ( "src/lib.rs" , "" )
2655
+ . build ( ) ;
2656
+
2657
+ p. cargo ( "generate-lockfile" )
2658
+ . with_status ( 101 )
2659
+ . with_stderr (
2660
+ "\
2661
+ [UPDATING] `dummy-registry` index
2662
+ [ERROR] no matching package named `bar` found
2663
+ location searched: registry `crates-io`
2664
+ required by package `foo v0.1.0 ([CWD])`
2665
+ " ,
2666
+ )
2667
+ . run ( ) ;
2668
+ }
2669
+
2635
2670
#[ cargo_test]
2636
2671
fn protocol ( ) {
2637
2672
cargo_process ( "install bar" )
You can’t perform that action at this time.
0 commit comments