Skip to content

Commit

Permalink
Attempt at enabling more tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tesujimath committed Jun 27, 2024
1 parent 290508c commit 9cda84b
Showing 1 changed file with 17 additions and 24 deletions.
41 changes: 17 additions & 24 deletions tests/path_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,31 +281,8 @@ fn test_real_clean_parent(path: &str, cwd: &str, expected: &str) {
#[test_case("A/B/C/_A/../A", "A")]
#[test_case("A/B/C/_B/..", "A")]
#[test_case("A/B/C/_B/../B/C/..", "A/B")]
fn test_real_clean_rel_symlinks(path: &str, expected: &str) {
let farm = LinkFarm::new();

farm.dir("A")
.dir("A/B")
.dir("A/B/C")
.file("A/a1")
.file("A/B/b1")
.symlink_rel("_x1", "x1")
.symlink_rel("_B", "A/B")
.symlink_rel("A/_dot", "..")
.symlink_rel("A/B/_A", "..")
.symlink_rel("A/B/_B", ".")
.symlink_rel("A/B/_b1", "b1")
.symlink_rel("A/B/_a1", "../a1")
.symlink_rel("A/B/C/_a1", "../../a1")
.symlink_rel("A/B/C/_A", "../../../A")
.symlink_rel("A/B/C/_B", "./..");

check_path_ok(&farm, None, path, expected, Path::real_clean);
}

#[test_case("A/B/C/_A/B", "A/B/C/_A/B")]
// #[cfg(not(target_family = "windows"))]
fn test_real_clean_rel_symlinks_not_windows(path: &str, expected: &str) {
fn test_real_clean_rel_symlinks(path: &str, expected: &str) {
let farm = LinkFarm::new();

farm.dir("A")
Expand Down Expand Up @@ -512,6 +489,22 @@ fn test_is_real_root_not_rel_indirect_symlinks_not_windows(path: &str) {

#[test_case("A/B/=b1")]
#[test_case("A/B/=a1")]
fn test_is_real_root_not_abs_symlinks(path: &str) {
let mut farm = LinkFarm::new();

farm.dir("A")
.dir("A/B")
.dir("A/C")
.file("A/B/b1")
.file("A/a1");

farm.symlink_abs("A/B/=b1", "A/B/b1")
.symlink_abs("A/B/=a1", "A/a1")
.symlink_abs("A/B/=C", "A/C");

check_is_real_root_ok(&farm, path, false);
}

#[test_case("A/B/=C")]
#[cfg(not(target_family = "windows"))]
fn test_is_real_root_not_abs_symlinks_not_windows(path: &str) {
Expand Down

0 comments on commit 9cda84b

Please sign in to comment.