Skip to content

Commit 08bc94d

Browse files
committed
Test that we skip missing nightlies
1 parent 5144b2e commit 08bc94d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/cli-misc.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,23 @@ fn update_nightly_even_with_incompat() {
769769
});
770770
}
771771

772+
#[test]
773+
fn nightly_backtrack_skips_missing() {
774+
clitools::setup(Scenario::Unavailable, &|config| {
775+
set_current_dist_date(config, "2015-01-01");
776+
expect_ok(config, &["rustup", "default", "nightly"]);
777+
778+
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
779+
780+
// nightly is missing on latest
781+
set_current_dist_date(config, "2015-01-02");
782+
783+
// update should not change nightly, and should not error
784+
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
785+
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
786+
});
787+
}
788+
772789
#[test]
773790
fn completion_rustup() {
774791
setup(&|config| {

0 commit comments

Comments
 (0)