Skip to content

Commit

Permalink
test(resolver): empty summaries passed in sort_summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Jan 12, 2024
1 parent 54fd66a commit c677f73
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cargo/core/resolver/version_prefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,13 @@ mod test {
.to_string()
);
}

#[should_panic = "`at` split index (is 1) should be <= len (is 0)"]
#[test]
fn test_empty_summaries() {
let vp = VersionPreferences::default();
let mut summaries = vec![];

vp.sort_summaries(&mut summaries, Some(VersionOrdering::MaximumVersionsFirst));
}
}

0 comments on commit c677f73

Please sign in to comment.