Skip to content

Commit

Permalink
make sure the complicated cases are at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed May 23, 2019
1 parent 5143c0c commit 514039e
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions tests/testsuite/support/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,25 +820,30 @@ pub fn registry_strategy(
))
}

PrettyPrintRegistry(
list_of_pkgid
.into_iter()
.zip(dependency_by_pkgid.into_iter())
.map(|(((name, ver), allow_deps), deps)| {
pkg_dep(
(name, ver).to_pkgid(),
if !allow_deps {
vec![dep_req("bad", "*")]
} else {
let mut deps = deps;
deps.sort_by_key(|d| d.name_in_toml());
deps.dedup_by_key(|d| d.name_in_toml());
deps
},
)
})
.collect(),
)
let mut out: Vec<Summary> = list_of_pkgid
.into_iter()
.zip(dependency_by_pkgid.into_iter())
.map(|(((name, ver), allow_deps), deps)| {
pkg_dep(
(name, ver).to_pkgid(),
if !allow_deps {
vec![dep_req("bad", "*")]
} else {
let mut deps = deps;
deps.sort_by_key(|d| d.name_in_toml());
deps.dedup_by_key(|d| d.name_in_toml());
deps
},
)
})
.collect();

if reverse_alphabetical {
// make sure the complicated cases are at the end
out.reverse();
}

PrettyPrintRegistry(out)
},
)
}
Expand Down

0 comments on commit 514039e

Please sign in to comment.