mirror of
https://github.com/topjohnwu/cxx.git
synced 2024-11-27 13:50:24 +00:00
Fix Windows symlink test to give reproducible error messages
After a `git clone -c core.symlinks=false` and `cargo test`, the script outputs a Git error as expected. When running `cargo test` again, the error message changes to "symlink support needs to be enabled". The test is done for an already existing directory, and the Windows mklink command _fails_ when the symlink exists already. This commit deletes the link prior to the symlink creation.
This commit is contained in:
parent
e35673d7de
commit
595ac27632
@ -61,6 +61,7 @@ fn main() {
|
||||
let from_dir = parent_dir.join("from");
|
||||
let to_dir = parent_dir.join("to");
|
||||
if fs::create_dir_all(&from_dir).is_ok()
|
||||
&& fs::remove_dir(&to_dir).is_ok()
|
||||
&& windows::symlink_dir(&from_dir, &to_dir).is_err()
|
||||
{
|
||||
message = DENIED;
|
||||
|
Loading…
Reference in New Issue
Block a user