-
Notifications
You must be signed in to change notification settings - Fork 1k
Update on install #2339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update on install #2339
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,12 @@ use std::io::Write; | |
| use std::process::Stdio; | ||
| use std::sync::Mutex; | ||
|
|
||
| macro_rules! for_host { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really feel that a used-once macro that just forms a function once, used in a single test is really pulling its weight - but if you feel it is going to be used again I'm cool with it being added.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm intending, once this is merged, to file an e-easy e-mentor help-wanted to move those macros into |
||
| ($s: expr) => { | ||
| &format!($s, this_host_triple()) | ||
| }; | ||
| } | ||
|
|
||
| pub fn setup_(complex: bool, f: &dyn Fn(&Config)) { | ||
| let scenario = if complex { | ||
| Scenario::UnavailableRls | ||
|
|
@@ -124,7 +130,11 @@ Rust is installed now. Great! | |
| fn blank_lines_around_stderr_log_output_update() { | ||
| setup(&|config| { | ||
| run_input(config, &["rustup-init"], "\n\n"); | ||
| let out = run_input(config, &["rustup-init"], "\n\n"); | ||
| let out = run_input( | ||
| config, | ||
| &["rustup-init", "--no-update-default-toolchain"], | ||
| "\n\n", | ||
| ); | ||
| println!("-- stdout --\n {}", out.stdout); | ||
| println!("-- stderr --\n {}", out.stderr); | ||
|
|
||
|
|
@@ -407,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)"))); | ||
| }) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this is a bit verbose. We have --no-self-update; perhaps just --no-update ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have a ponder.
--no-updatefeels a little odd but the terseness may be okay. I'll reconsider in the face of the rest of the args, it is a bit long yes.