Browse Source

Allow FileUtilsTest to run on DOS/Windows when current drive letter is not C:

PR: 21383
Submitted by: Brad Clarke ( bclarke at booksys dot com)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274809 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 22 years ago
parent
commit
88c40c7306
1 changed files with 2 additions and 8 deletions
  1. +2
    -8
      src/testcases/org/apache/tools/ant/util/FileUtilsTest.java

+ 2
- 8
src/testcases/org/apache/tools/ant/util/FileUtilsTest.java View File

@@ -429,20 +429,14 @@ public class FileUtilsTest extends TestCase {
public void testToURI() {
String dosRoot = null;
if (Os.isFamily("dos")) {
dosRoot = "C:/";
dosRoot = System.getProperty("user.dir").charAt(0) + ":/";
}
else
{
dosRoot = "";
}
if (Os.isFamily("dos")) {
assertEquals("file:///"+ dosRoot + "foo", fu.toURI("c:\\foo"));
}
if (Os.isFamily("dos")) {
// this amounts to : are we under cygwin ?
if (Character.isLowerCase(System.getProperty("user.dir").charAt(0))) {
dosRoot = "c:/";
}
assertEquals("file:///C:/foo", fu.toURI("c:\\foo"));
}
assertEquals("file:///" + dosRoot + "foo", fu.toURI("/foo"));
assertEquals("file:./foo", fu.toURI("./foo"));


Loading…
Cancel
Save