Skip to content

Commit

Permalink
Merge pull request #138 from rust-secure-code/1.77
Browse files Browse the repository at this point in the history
Fix tests on Rust 1.77
  • Loading branch information
Shnatsel authored Mar 25, 2024
2 parents 24df0e1 + 2ac59f8 commit 4d92c13
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion cargo-auditable/tests/it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,29 @@ 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".
// Weirdly it doesn't use OS path separator, it always uses '/'
pkgid
.rsplit_once('/')
.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 4d92c13

Please sign in to comment.