|
@@ -1,7 +1,7 @@ |
|
|
/* |
|
|
/* |
|
|
* The Apache Software License, Version 1.1 |
|
|
* The Apache Software License, Version 1.1 |
|
|
* |
|
|
* |
|
|
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights |
|
|
|
|
|
|
|
|
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights |
|
|
* reserved. |
|
|
* reserved. |
|
|
* |
|
|
* |
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
* Redistribution and use in source and binary forms, with or without |
|
@@ -104,6 +104,29 @@ public class PathTest extends TestCase { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void testRelativePathUnixStyle() { |
|
|
|
|
|
project.setBasedir("src/etc"); |
|
|
|
|
|
Path p = new Path(project, "..:testcases"); |
|
|
|
|
|
String[] l = p.list(); |
|
|
|
|
|
assertEquals("two items, Unix style", 2, l.length); |
|
|
|
|
|
if (isUnixStyle) { |
|
|
|
|
|
assertTrue("test resolved relative to src/etc", |
|
|
|
|
|
l[0].endsWith("/src")); |
|
|
|
|
|
assertTrue("test resolved relative to src/etc", |
|
|
|
|
|
l[1].endsWith("/src/etc/testcases")); |
|
|
|
|
|
} else if (isNetWare) { |
|
|
|
|
|
assertTrue("test resolved relative to src/etc", |
|
|
|
|
|
l[0].endsWith("\\src")); |
|
|
|
|
|
assertTrue("test resolved relative to src/etc", |
|
|
|
|
|
l[1].endsWith("\\src\\etc\\testcases")); |
|
|
|
|
|
} else { |
|
|
|
|
|
assertTrue("test resolved relative to src/etc", |
|
|
|
|
|
l[0].endsWith("\\src")); |
|
|
|
|
|
assertTrue("test resolved relative to src/etc", |
|
|
|
|
|
l[1].endsWith("\\src\\etc\\testcases")); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public void testConstructorWindowsStyle() { |
|
|
public void testConstructorWindowsStyle() { |
|
|
Path p = new Path(project, "\\a;\\b"); |
|
|
Path p = new Path(project, "\\a;\\b"); |
|
|
String[] l = p.list(); |
|
|
String[] l = p.list(); |
|
|