Skip to content

Commit efb6935

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

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/suite/cli_misc.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,33 @@ 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+
}
731+
705732
// issue #1169
706733
/// A toolchain that is a stale symlink should be correctly uninstalled.
707734
#[test]

0 commit comments

Comments
 (0)