Add `PRERELEASE_VERSION_TEST` to dependency version if environment is test.
@@ -39,11 +39,18 @@ pub fn get_latest_dependency(
if env::var("CARGO_IS_TEST").is_ok() {
// We are in a simulated reality. Nothing is real here.
// FIXME: Use actual test handling code.
+ if flag_allow_prerelease {
+ return Ok(
+ Dependency::new(crate_name)
+ .set_version(&format!("{}--PRERELEASE_VERSION_TEST", crate_name)),
+ );
+ } else {
return Ok(
Dependency::new(crate_name)
.set_version(&format!("{}--CURRENT_VERSION_TEST", crate_name)),
);
}
+ }
let crate_versions = fetch_cratesio(&format!("/crates/{}", crate_name))?;
