|
|
@@ -624,6 +624,22 @@ public class FileUtilsTest { |
|
|
|
assertFalse(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/bar"), true)); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void isLeadingPathAndTrailingSlashesOnUnix() throws IOException { |
|
|
|
assumeFalse("Test doesn't run on DOS", Os.isFamily("dos")); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar/"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/"), true)); |
|
|
|
|
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar/"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/"), false)); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void isLeadingPathCanonicalVersionWorksAsExpectedOnDos() throws IOException { |
|
|
|
assumeTrue("Test only runs on DOS", Os.isFamily("dos")); |
|
|
@@ -634,6 +650,22 @@ public class FileUtilsTest { |
|
|
|
assertFalse(FILE_UTILS.isLeadingPath(new File("C:\\foo"), new File("C:\\bar"), true)); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void isLeadingPathAndTrailingSlashesOnDos() throws IOException { |
|
|
|
assumeTrue("Test only runs on DOS", Os.isFamily("dos")); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar\\"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo"), true)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo"), new File("c:\\foo\\"), true)); |
|
|
|
|
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar\\"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo"), false)); |
|
|
|
assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo"), new File("c:\\foo\\"), false)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* adapt file separators to local conventions |
|
|
|
*/ |
|
|
|