@@ -15,10 +15,13 @@ */ #include "config.h" #import "OFURL.h" +#ifdef OF_HAVE_FILES +# import "OFFileManager.h" +#endif #import "OFNumber.h" #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFInvalidFormatException.h" @@ -51,10 +54,17 @@ [[[OFURL URLWithString: @"foo/bar" relativeToURL: [OFURL URLWithString: @"http://h/qux/?x"]] string] isEqual: @"http://h/qux/foo/bar"] && [[[OFURL URLWithString: @"http://foo/?q" relativeToURL: u1] string] isEqual: @"http://foo/?q"]) + +#ifdef OF_HAVE_FILES + TEST(@"+[fileURLWithPath:isDirectory:]", + [[[OFURL fileURLWithPath: @"testfile.txt"] fileSystemRepresentation] + isEqual: [[[OFFileManager defaultManager] currentDirectoryPath] + stringByAppendingPathComponent: @"testfile.txt"]]) +#endif TEST(@"-[string]", [[u1 string] isEqual: url_str] && [[u2 string] isEqual: @"http://foo:80"] && [[u3 string] isEqual: @"http://bar/"] &&