Skip to content

Commit

Permalink
Add a test for coercion by dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita240 committed Mar 5, 2024
1 parent 7c7df1c commit c97b7a7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/resolver-tests/tests/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,24 @@ fn test_wildcard_major_duplicate_selection() {
);
}

#[test]
fn test_wildcard_major_coerced_by_subdepdency() {
let reg = registry(vec![
pkg!("foo" => [dep_req("util", "0.1")]),
pkg!(("util", "0.1.0")),
pkg!(("util", "0.2.0")),
]);

let res = resolve(vec![dep_req("foo", "1.0.0"), dep_req("util", "0.*")], &reg).unwrap();

// In this case, both 0.1.0 and 0.2.0 satisfy root, but it's being coerced
// by the subdependency of foo.
assert_same(
&res,
&names(&[("root", "1.0.0"), ("foo", "1.0.0"), ("util", "0.1.0")]),
);
}

#[test]
fn test_range_major() {
let reg = registry(vec![
Expand Down

0 comments on commit c97b7a7

Please sign in to comment.