Skip to content

Commit

Permalink
Fix tests on Rust 1.77
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnatsel committed Mar 25, 2024
1 parent 24df0e1 commit 5317a27
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cargo-auditable/tests/it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,28 @@ where
binaries
})
.for_each(|(package, binary)| {
bins.entry(package).or_insert(Vec::new()).push(binary);
bins.entry(pkgid_to_bin_name(&package))
.or_insert(Vec::new())
.push(binary);
});
bins
}

fn pkgid_to_bin_name(pkgid: &str) -> String {
// the input is string in the format such as
// "path+file:///home/shnatsel/Code/cargo-auditable/cargo-auditable/tests/fixtures/lib_and_bin_crate#0.1.0"
// (for full docs see `cargo pkgid`)
// and we need just the crate name, e.g. "lib_and_bin_crate"
pkgid
.rsplit_once(std::path::MAIN_SEPARATOR)
.unwrap()
.1
.split_once('#')
.unwrap()
.0
.to_owned()
}

fn ensure_build_succeeded(output: &Output) {
if !output.status.success() {
let stderr = std::io::stderr();
Expand Down

0 comments on commit 5317a27

Please sign in to comment.