Skip to content

Commit c7c20dc

Browse files
committed
test: add test for rustup toolchain install --no-update
1 parent ccec3df commit c7c20dc

File tree

2 files changed

+46
-18
lines changed

2 files changed

+46
-18
lines changed

tests/suite/cli_rustup.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,32 @@ info: it's active because: overridden by '[TOOLCHAIN_FILE]'
17371737
.is_ok();
17381738
}
17391739

1740+
#[tokio::test]
1741+
async fn toolchain_install_no_change_with_no_update() {
1742+
let mut cx = CliTestContext::new(Scenario::None).await;
1743+
1744+
{
1745+
let cx = cx.with_dist_dir(Scenario::ArchivesV2_2015_01_01);
1746+
cx.config
1747+
.expect(["rustup", "toolchain", "add", "stable"])
1748+
.await
1749+
.is_ok();
1750+
}
1751+
1752+
let cx = cx.with_dist_dir(Scenario::SimpleV2);
1753+
cx.config
1754+
.expect(["rustup", "install", "--no-update", "stable"])
1755+
.await
1756+
.with_stdout(snapbox::str![[r#"
1757+
1758+
stable-[HOST_TRIPLE] unchanged - 1.0.0 (hash-stable-1.0.0)
1759+
1760+
1761+
"#]])
1762+
.with_stderr(snapbox::str![[""]])
1763+
.is_ok();
1764+
}
1765+
17401766
#[tokio::test]
17411767
async fn toolchain_update_is_like_update() {
17421768
let cx = CliTestContext::new(Scenario::SimpleV2).await;

tests/suite/cli_rustup_ui/rustup_toolchain_cmd_install_cmd_help_flag.stdout.term.svg

Lines changed: 20 additions & 18 deletions
Loading

0 commit comments

Comments
 (0)