Skip to content

Commit

Permalink
Windows flailing.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Sep 21, 2024
1 parent 204352d commit bacd12b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cap-primitives/src/windows/fs/open_unchecked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ fn handle_open_result(
Err(e) if e.kind() == io::ErrorKind::NotFound => Err(OpenUncheckedError::NotFound(e)),
Err(e) => match e.raw_os_error() {
Some(code) => match code as u32 {
Foundation::ERROR_INVALID_NAME => {
Err(OpenUncheckedError::Symlink(e, SymlinkKind::Dir))
}
Foundation::ERROR_FILE_NOT_FOUND | Foundation::ERROR_PATH_NOT_FOUND => {
Err(OpenUncheckedError::NotFound(e))
}
Expand Down
26 changes: 22 additions & 4 deletions tests/fs_additional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,8 @@ fn dotdot_in_middle_of_symlink() {
}

/// Like `dotdot_in_middle_of_symlink` but with a `/.` at the end.
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
fn dotdot_slashdot_in_middle_of_symlink() {
let tmpdir = tmpdir();
Expand All @@ -1080,7 +1082,7 @@ fn dotdot_slashdot_in_middle_of_symlink() {
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg(not(windows))]
//#[cfg_attr(windows, ignore)]
fn dotdot_more_in_middle_of_symlink() {
let tmpdir = tmpdir();

Expand All @@ -1098,8 +1100,10 @@ fn dotdot_more_in_middle_of_symlink() {
}

/// Like `dotdot_more_in_middle_of_symlink`, but with a `/.` at the end.
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg(not(windows))]
//#[cfg_attr(windows, ignore)]
fn dotdot_slashdot_more_in_middle_of_symlink() {
let tmpdir = tmpdir();

Expand All @@ -1121,7 +1125,7 @@ fn dotdot_slashdot_more_in_middle_of_symlink() {
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg(not(windows))]
//#[cfg_attr(windows, ignore)]
fn dotdot_other_in_middle_of_symlink() {
let tmpdir = tmpdir();

Expand All @@ -1139,8 +1143,10 @@ fn dotdot_other_in_middle_of_symlink() {
}

/// Like `dotdot_other_in_middle_of_symlink`, but with `/.` at the end.
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg(not(windows))]
//#[cfg_attr(windows, ignore)]
fn dotdot_slashdot_other_in_middle_of_symlink() {
let tmpdir = tmpdir();

Expand Down Expand Up @@ -1177,7 +1183,10 @@ fn dotdot_even_more_in_middle_of_symlink() {
}

/// Like `dotdot_even_more_in_middle_of_symlink`, but with a `/.` at the end.
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg_attr(windows, ignore)]
fn dotdot_slashdot_even_more_in_middle_of_symlink() {
let tmpdir = tmpdir();

Expand Down Expand Up @@ -1214,7 +1223,10 @@ fn dotdot_even_other_in_middle_of_symlink() {
}

/// Like `dotdot_even_other_in_middle_of_symlink`, but with a `/.` at the end.
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg_attr(windows, ignore)]
fn dotdot_slashdot_even_other_in_middle_of_symlink() {
let tmpdir = tmpdir();

Expand Down Expand Up @@ -1260,7 +1272,10 @@ fn dotdot_at_end_of_symlink() {
}

/// Like `dotdot_at_end_of_symlink`, but with a `/.` at the end.
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg_attr(windows, ignore)]
fn dotdot_slashdot_at_end_of_symlink() {
let tmpdir = tmpdir();

Expand Down Expand Up @@ -1313,7 +1328,10 @@ fn dotdot_at_end_of_symlink_all_inside_dir() {
}

/// `dotdot_at_end_of_symlink_all_inside_dir`, but with a `/.` at the end.
///
/// This fails on Windows for unknown reasons. Patches welcome.
#[test]
//#[cfg_attr(windows, ignore)]
fn dotdot_slashdot_at_end_of_symlink_all_inside_dir() {
let tmpdir = tmpdir();

Expand Down

0 comments on commit bacd12b

Please sign in to comment.