diff --git a/lib/bolt/core/src/dep/cargo/cli.rs b/lib/bolt/core/src/dep/cargo/cli.rs index 39952513e2..9aac1f3d7c 100644 --- a/lib/bolt/core/src/dep/cargo/cli.rs +++ b/lib/bolt/core/src/dep/cargo/cli.rs @@ -320,11 +320,15 @@ pub async fn build_tests<'a, T: AsRef>( let v = serde_json::from_str::(line).context("invalid json")?; if v["reason"] == "compiler-artifact" && v["target"]["kind"] == json!(["test"]) { if let Some(executable) = v["filenames"][0].as_str() { - // Parse package name + // Parsing the cargo package name (foo-bar) from + // path+file:///foo/bar#foo-bar@0.0.1 let package = v["package_id"] .as_str() .context("missing package_id")? - .split_once(" ") + .split_once("#") + .context("split_once failed")? + .1 + .split_once("@") .context("split_once failed")? .0;