Skip to content

Commit

Permalink
Update resolving_with_sys_crates tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita240 committed Mar 5, 2024
1 parent 016dc70 commit bf9754b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions crates/resolver-tests/tests/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,34 @@ fn resolving_with_sys_crates() {

let res = resolve(vec![dep_req("d", "1"), dep_req("r", "1")], &reg).unwrap();

assert_same(
&res,
&names(&[
("root", "1.0.0"),
("d", "1.0.0"),
("r", "1.0.0"),
("l-sys", "0.9.1"),
("l", "0.9.1"),
]),
);
}

#[test]
fn resolving_with_sys_crates_duplicates() {
// This is based on issues/4902
// With `l` a normal library we get 2copies so everyone gets the newest compatible.
// But `l-sys` a library with a links attribute we make sure there is only one.
let reg = registry(vec![
pkg!(("l-sys", "0.9.1")),
pkg!(("l-sys", "0.10.0")),
pkg!(("l", "0.9.1") => [dep_req("l-sys", ">=0.8.0, <=0.10.0")]),
pkg!(("l", "0.10.0") => [dep_req("l-sys", "0.9")]),
pkg!(("d", "1.0.0") => [dep_req("l", "0.10")]),
pkg!(("r", "1.0.0") => [dep_req("l", "0.9")]),
]);

let res = resolve(vec![dep_req("d", "1"), dep_req("r", "1")], &reg).unwrap();

assert_same(
&res,
&names(&[
Expand Down

0 comments on commit bf9754b

Please sign in to comment.