Skip to content

Commit b02bc1a

Browse files
committed
test: Ensure we try and update by default
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
1 parent 9bf7f46 commit b02bc1a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/cli-inst-interactive.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ use std::io::Write;
1414
use std::process::Stdio;
1515
use std::sync::Mutex;
1616

17+
macro_rules! for_host {
18+
($s: expr) => {
19+
&format!($s, this_host_triple())
20+
};
21+
}
22+
1723
pub fn setup_(complex: bool, f: &dyn Fn(&Config)) {
1824
let scenario = if complex {
1925
Scenario::UnavailableRls
@@ -411,3 +417,15 @@ fn test_succeed_if_rustup_sh_already_installed_env_var_set() {
411417
assert!(!out.stdout.contains("Continue? (y/N)"));
412418
})
413419
}
420+
421+
#[test]
422+
fn installing_when_already_installed_updates_toolchain() {
423+
setup(&|config| {
424+
run_input(config, &["rustup-init"], "\n\n");
425+
let out = run_input(config, &["rustup-init"], "\n\n");
426+
println!("stdout:\n{}\n...\n", out.stdout);
427+
assert!(out
428+
.stdout
429+
.contains(for_host!("stable-{} unchanged - 1.1.0 (hash-stable-1.1.0)")));
430+
})
431+
}

0 commit comments

Comments
 (0)