Skip to content

Commit

Permalink
Adjusty test for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jun 6, 2024
1 parent 756ea1b commit 27b0943
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/test/java/org/apache/commons/io/file/PathUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,17 @@ public void testGetBaseNamePathCornerCases() {
public void testGetDosFileAttributeView() {
// dir
final DosFileAttributeView dosFileAttributeView = PathUtils.getDosFileAttributeView(current());
final Path path = Paths.get("this-file-does-not-exist-at.all");
assertFalse(Files.exists(path));
if (SystemUtils.IS_OS_MAC) {
assertNull(dosFileAttributeView);
// missing file
assertNull(PathUtils.getDosFileAttributeView(path));
} else {
assertNotNull(dosFileAttributeView);
// missing file
assertNotNull(PathUtils.getDosFileAttributeView(path));
}
// missing file
final Path path = Paths.get("this-file-does-not-exist-at.all");
assertFalse(Files.exists(path));
assertNotNull(PathUtils.getDosFileAttributeView(path));
// null
assertThrows(NullPointerException.class, () -> PathUtils.getDosFileAttributeView(null));
}
Expand Down

0 comments on commit 27b0943

Please sign in to comment.