Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/test/clitools.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! A mock distribution server used by tests/cli-v1.rs and
//! tests/cli-v2.rs
use std::{
borrow::Cow,
cell::RefCell,
collections::HashMap,
env::{self, consts::EXE_SUFFIX},
Expand Down Expand Up @@ -32,6 +33,7 @@ use crate::test::this_host_triple;
use crate::utils;

use super::{
CROSS_ARCH1, CROSS_ARCH2,
dist::{MockDistServer, MockManifestVersion, Release, RlsStatus, change_channel_date},
mock::MockFile,
};
Expand Down Expand Up @@ -74,7 +76,15 @@ impl Assert {
pub fn new(output: SanitizedOutput) -> Self {
let mut redactions = Redactions::new();
redactions
.extend([("[HOST_TRIPLE]", this_host_triple())])
.extend([
(
"[CURRENT_VERSION]",
Cow::Borrowed(env!("CARGO_PKG_VERSION")),
),
("[HOST_TRIPLE]", Cow::Owned(this_host_triple())),
("[CROSS_ARCH_I]", Cow::Borrowed(CROSS_ARCH1)),
("[CROSS_ARCH_II]", Cow::Borrowed(CROSS_ARCH2)),
])
.expect("invalid redactions detected");
Self { output, redactions }
}
Expand Down
3 changes: 1 addition & 2 deletions tests/suite/cli_exact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,9 @@ async fn check_updates_self_no_change() {
cx.config
.expect(["rustup", "check"])
.await
.extend_redactions([("[VERSION]", current_version)])
.is_err()
.with_stdout(snapbox::str![[r#"
rustup - Up to date : [VERSION]
rustup - Up to date : [CURRENT_VERSION]

"#]]);
}
Expand Down
Loading