You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2018/07/02 08:36:19 UTC
[1/2] ant git commit: some additional tests for isLeadingPath testing
for trailing slashes
Repository: ant
Updated Branches:
refs/heads/master 2f64e0b51 -> 8018d9f40
some additional tests for isLeadingPath testing for trailing slashes
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/4987c2aa
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/4987c2aa
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/4987c2aa
Branch: refs/heads/master
Commit: 4987c2aac8d2a99bac04eb0d4f4c8148f06ccd19
Parents: 5265551
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jul 2 10:35:32 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jul 2 10:35:32 2018 +0200
----------------------------------------------------------------------
.../apache/tools/ant/util/FileUtilsTest.java | 32 ++++++++++++++++++++
1 file changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/4987c2aa/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
index 716751d..d82b7b6 100644
--- a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
@@ -625,6 +625,22 @@ public class FileUtilsTest {
}
@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"));
assertTrue(FILE_UTILS.isLeadingPath(new File("C:\\foo"), new File("C:\\foo\\bar"), true));
@@ -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
*/
[2/2] ant git commit: Merge branch '1.9.x'
Posted by bo...@apache.org.
Merge branch '1.9.x'
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/8018d9f4
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/8018d9f4
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/8018d9f4
Branch: refs/heads/master
Commit: 8018d9f40aee0125b7af47f16728aa9d81caca61
Parents: 2f64e0b 4987c2a
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jul 2 10:36:11 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jul 2 10:36:11 2018 +0200
----------------------------------------------------------------------
.../apache/tools/ant/util/FileUtilsTest.java | 32 ++++++++++++++++++++
1 file changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/8018d9f4/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
----------------------------------------------------------------------