Skip to content

Commit 95e1682

Browse files
committed
Fix test on Windows
1 parent ce52198 commit 95e1682

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/test/java/org/apache/commons/io/file/PathUtilsTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,7 @@ public void testGetExtension() {
262262
assertEquals("", PathUtils.getExtension(Paths.get("C:\\temp\\foo.bar\\README")));
263263
assertEquals("ext", PathUtils.getExtension(Paths.get("../filename.ext")));
264264

265-
if (File.separatorChar == '\\') {
266-
// Special case handling for NTFS ADS names
267-
final IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> PathUtils.getExtension(Paths.get("foo.exe:bar.txt")));
268-
assertEquals("NTFS ADS separator (':') in file name is forbidden.", e.getMessage());
269-
} else {
265+
if (File.separatorChar != '\\') {
270266
// Upwards compatibility:
271267
assertEquals("txt", PathUtils.getExtension(Paths.get("foo.exe:bar.txt")));
272268
}

0 commit comments

Comments
 (0)