--- a/jdk/test/demo/zipfs/PathOps.java Sat Jan 22 08:43:25 2011 -0500
+++ b/jdk/test/demo/zipfs/PathOps.java Mon Jan 24 11:47:06 2011 -0800
@@ -193,6 +193,17 @@
return this;
}
+ PathOps isSameFile(String target) {
+ try {
+ out.println("check two paths are same");
+ checkPath();
+ check(path.isSameFile(test(target).path()), true);
+ } catch (IOException ioe) {
+ fail();
+ }
+ return this;
+ }
+
PathOps invalid() {
if (!(exc instanceof InvalidPathException)) {
out.println("InvalidPathException not thrown as expected");
@@ -344,7 +355,12 @@
.normalize("foo");
test("/foo/bar/gus/../..")
.normalize("/foo");
-
+ test("/./.")
+ .normalize("/");
+ test("/.")
+ .normalize("/");
+ test("/./abc")
+ .normalize("/abc");
// invalid
test("foo\u0000bar")
.invalid();
@@ -365,6 +381,10 @@
.root("/")
.parent("/foo")
.name("bar");
+
+ // isSameFile
+ test("/fileDoesNotExist")
+ .isSameFile("/fileDoesNotExist");
}
static void npes() {