Skip to content

Commit 1b31824

Browse files
committed
test(cli-self-upd): migrate to .expect() APIs
1 parent 6f630cf commit 1b31824

File tree

2 files changed

+463
-323
lines changed

2 files changed

+463
-323
lines changed

src/test/clitools.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! A mock distribution server used by tests/cli-v1.rs and
22
//! tests/cli-v2.rs
33
use std::{
4+
borrow::Cow,
45
cell::RefCell,
56
collections::HashMap,
67
env::{self, consts::EXE_SUFFIX},
@@ -32,6 +33,7 @@ use crate::test::this_host_triple;
3233
use crate::utils;
3334

3435
use super::{
36+
CROSS_ARCH1, CROSS_ARCH2,
3537
dist::{MockDistServer, MockManifestVersion, Release, RlsStatus, change_channel_date},
3638
mock::MockFile,
3739
};
@@ -74,7 +76,11 @@ impl Assert {
7476
pub fn new(output: SanitizedOutput) -> Self {
7577
let mut redactions = Redactions::new();
7678
redactions
77-
.extend([("[HOST_TRIPLE]", this_host_triple())])
79+
.extend([
80+
("[HOST_TRIPLE]", Cow::Owned(this_host_triple())),
81+
("[CROSS_ARCH_I]", Cow::Borrowed(CROSS_ARCH1)),
82+
("[CROSS_ARCH_II]", Cow::Borrowed(CROSS_ARCH2)),
83+
])
7884
.expect("invalid redactions detected");
7985
Self { output, redactions }
8086
}

0 commit comments

Comments
 (0)