Skip to content

Commit

Permalink
test: Ensure we try and update by default
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
  • Loading branch information
kinnison committed Jun 13, 2020
1 parent 9bf7f46 commit b02bc1a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/cli-inst-interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ use std::io::Write;
use std::process::Stdio;
use std::sync::Mutex;

macro_rules! for_host {
($s: expr) => {
&format!($s, this_host_triple())
};
}

pub fn setup_(complex: bool, f: &dyn Fn(&Config)) {
let scenario = if complex {
Scenario::UnavailableRls
Expand Down Expand Up @@ -411,3 +417,15 @@ fn test_succeed_if_rustup_sh_already_installed_env_var_set() {
assert!(!out.stdout.contains("Continue? (y/N)"));
})
}

#[test]
fn installing_when_already_installed_updates_toolchain() {
setup(&|config| {
run_input(config, &["rustup-init"], "\n\n");
let out = run_input(config, &["rustup-init"], "\n\n");
println!("stdout:\n{}\n...\n", out.stdout);
assert!(out
.stdout
.contains(for_host!("stable-{} unchanged - 1.1.0 (hash-stable-1.1.0)")));
})
}

0 comments on commit b02bc1a

Please sign in to comment.