Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
crodas committed Feb 22, 2024
1 parent cd614a9 commit 6ea22f0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,23 @@ fn fuelup_toolchain_uninstall() -> Result<()> {
for toolchain in toolchains {
let toolchain_with_target = format_toolchain_with_target(toolchain);
let output = cfg.fuelup(&["toolchain", "uninstall", toolchain]);
let expected_stdout = format!("toolchain '{toolchain_with_target}' does not exist\n");

assert_eq!(output.stdout, expected_stdout);
let expected_stdout = format!("Toolchain '{toolchain_with_target}' does not exist\n");
assert!(output.stdout.contains(&expected_stdout));
}
})?;

testcfg::setup(FuelupState::AllInstalled, &|cfg| {
let toolchains = ["latest", "nightly", &format!("nightly-{DATE}")];
for toolchain in toolchains {
for toolchain in &toolchains[0..2] {
let toolchain_with_target = format_toolchain_with_target(toolchain);
let output = cfg.fuelup(&["toolchain", "uninstall", toolchain]);
let expected_stdout = format!("toolchain '{toolchain_with_target}' uninstalled\n");

let expected_stdout = format!("Toolchain '{toolchain_with_target}' uninstalled\n");
assert!(output.stdout.contains(&expected_stdout));
}

let output = cfg.fuelup(&["toolchain", "uninstall", toolchains[2]]);
let expected_stdout = "Cannot uninstall the last toolchain\n".to_string();
assert!(output.stdout.contains(&expected_stdout));
})?;

Ok(())
Expand Down

0 comments on commit 6ea22f0

Please sign in to comment.