Skip to content

Commit fe93d5b

Browse files
committed
test(cli): ensure the resolution of #3344
1 parent a490590 commit fe93d5b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/suite/cli_misc.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,36 @@ fn toolchains_symlink() {
702702
});
703703
}
704704

705+
// issue #3344
706+
/// `~/.rustup/tmp` and `~/.rustup/downloads` are permitted to be symlinks.
707+
#[test]
708+
#[cfg(any(unix, windows))]
709+
fn tmp_downloads_symlink() {
710+
use rustup::utils::raw::symlink_dir;
711+
use std::fs;
712+
713+
clitools::test(Scenario::ArchivesV2, &|config| {
714+
let cwd = config.current_dir();
715+
716+
let test_tmp = cwd.join("tmp-test");
717+
fs::create_dir(&test_tmp).unwrap();
718+
symlink_dir(&test_tmp, &config.rustupdir.join("tmp")).unwrap();
719+
720+
let test_downloads = cwd.join("tmp-downloads");
721+
fs::create_dir(&test_downloads).unwrap();
722+
symlink_dir(&test_downloads, &config.rustupdir.join("downloads")).unwrap();
723+
724+
set_current_dist_date(config, "2015-01-01");
725+
config.expect_ok(&["rustup", "default", "nightly"]);
726+
727+
set_current_dist_date(config, "2015-01-02");
728+
config.expect_ok(&["rustup", "update"]);
729+
730+
assert!(config.rustupdir.join("tmp").exists());
731+
assert!(config.rustupdir.join("downloads").exists());
732+
});
733+
}
734+
705735
// issue #1169
706736
/// A toolchain that is a stale symlink should be correctly uninstalled.
707737
#[test]

0 commit comments

Comments
 (0)