Skip to content

Commit

Permalink
Test current behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jun 6, 2024
1 parent 19e9918 commit cf12941
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/java/org/apache/commons/io/file/PathUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,14 @@ public void testGetBaseNamePathCornerCases() {

@Test
public void testGetDosFileAttributeView() {
// dir
assertNotNull(PathUtils.getDosFileAttributeView(current()));
// 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));
}

@Test
Expand Down Expand Up @@ -458,7 +465,7 @@ public void testReadStringSimpleUtf8() throws IOException {
assertEquals(expected, PathUtils.readString(path, StandardCharsets.UTF_8));
assertEquals(expected, PathUtils.readString(path, null));
}

@Test
public void testSetReadOnlyFile() throws IOException {
final Path resolved = tempDirPath.resolve("testSetReadOnlyFile.txt");
Expand Down

0 comments on commit cf12941

Please sign in to comment.