Skip to content

Commit ac1a8c4

Browse files
authored
Merge pull request #2429 from rbtcollins/unit-tests
Tune test uninstall_deletes_bins for performance
2 parents 6278bba + 7a6f5f3 commit ac1a8c4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/cli-self-upd.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,22 @@ fn install_creates_cargo_home() {
176176
}
177177

178178
#[test]
179+
/// Functional test needed here - we need to do the full dance where we start
180+
/// with rustup.exe and end up deleting that exe itself.
179181
fn uninstall_deletes_bins() {
180-
setup(&|config| {
181-
expect_ok(config, &["rustup-init", "-y"]);
182+
clitools::setup(Scenario::Empty, &|config| {
183+
expect_ok(
184+
config,
185+
&[
186+
"rustup-init",
187+
"-y",
188+
"--no-modify-path",
189+
"--default-toolchain",
190+
"none",
191+
],
192+
);
193+
// no-modify-path isn't needed here, as the test-dir-path isn't present
194+
// in the registry, so the no-change code path will be triggered.
182195
expect_ok(config, &["rustup", "self", "uninstall", "-y"]);
183196
let rustup = config.cargodir.join(&format!("bin/rustup{}", EXE_SUFFIX));
184197
let rustc = config.cargodir.join(&format!("bin/rustc{}", EXE_SUFFIX));

0 commit comments

Comments
 (0)