Skip to content

Commit

Permalink
Create symlink in tests to fix cargo-vendor builds.
Browse files Browse the repository at this point in the history
Closes #26.
  • Loading branch information
whitequark committed Jul 23, 2023
1 parent 66378cb commit fcccd45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/base_directories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,11 @@ mod test {
let config_dir = format!("{}/config", symlinks_dir);
let myapp_dir = format!("{}/myapp", config_dir);

if Path::new(&myapp_dir).exists() {
fs::remove_file(&myapp_dir).unwrap();
}
std::os::unix::fs::symlink("../../user/config/myapp", &myapp_dir).unwrap();

assert!(path_exists(&myapp_dir));
assert!(path_exists(&config_dir));
assert!(path_exists(&symlinks_dir));
Expand All @@ -1284,5 +1289,7 @@ mod test {
xd.find_config_file("user_config.file").unwrap(),
PathBuf::from(&format!("{}/user_config.file", myapp_dir))
);

fs::remove_file(&myapp_dir).unwrap();
}
}
1 change: 0 additions & 1 deletion test_files/symlinks/config/myapp

This file was deleted.

0 comments on commit fcccd45

Please sign in to comment.