Skip to content

Commit

Permalink
test(cli): ensure the resolution of #3344
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Apr 2, 2024
1 parent 3f57299 commit b4f8c1c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/suite/cli_misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,33 @@ fn toolchains_symlink() {
});
}

// issue #3344
/// `~/.rustup/tmp` and `~/.rustup/downloads` are permitted to be symlinks.
#[test]
#[cfg(any(unix, windows))]
fn tmp_downloads_symlink() {
use rustup::utils::raw::symlink_dir;
use std::fs;

clitools::test(Scenario::ArchivesV2, &|config| {
let cwd = config.current_dir();

let test_tmp = cwd.join("tmp-test");
fs::create_dir(&test_tmp).unwrap();
symlink_dir(&test_tmp, &config.rustupdir.join("tmp")).unwrap();

let test_downloads = cwd.join("tmp-downloads");
fs::create_dir(&test_downloads).unwrap();
symlink_dir(&test_downloads, &config.rustupdir.join("downloads")).unwrap();

set_current_dist_date(config, "2015-01-01");
config.expect_ok(&["rustup", "default", "nightly"]);

set_current_dist_date(config, "2015-01-02");
config.expect_ok(&["rustup", "update"]);
});
}

// issue #1169
/// A toolchain that is a stale symlink should be correctly uninstalled.
#[test]
Expand Down

0 comments on commit b4f8c1c

Please sign in to comment.