Differences From Artifact [ac6cede6ad]:
- File
tests/OFURLTests.m
— part of check-in
[dc0c6c34ab]
at
2019-02-17 22:44:23
on branch trunk
— tests: Only import ObjFW.h
This prevents forgetting to add an import to ObjFW.h, as the tests would
then not compile. (user: js, size: 10367) [annotate] [blame] [check-ins using]
To Artifact [623af6a22a]:
- File tests/OFURLTests.m — part of check-in [a4b719e4e9] at 2019-03-24 22:29:27 on branch trunk — Add support for UNC paths on Windows (user: js, size: 10904) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | relativeToURL: u1]) #ifdef OF_HAVE_FILES TEST(@"+[fileURLWithPath:]", [[[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/"] && [[u4 string] isEqual: @"file:///etc/passwd"]) | > > > > > > > > > > > > > | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | relativeToURL: u1]) #ifdef OF_HAVE_FILES TEST(@"+[fileURLWithPath:]", [[[OFURL fileURLWithPath: @"testfile.txt"] fileSystemRepresentation] isEqual: [[[OFFileManager defaultManager] currentDirectoryPath] stringByAppendingPathComponent: @"testfile.txt"]]) # ifdef OF_WINDOWS OFURL *tmp; TEST(@"+[fileURLWithPath:] with UNC", (tmp = [OFURL fileURLWithPath: @"\\\\foo\\bar"]) && [tmp.host isEqual: @"foo"] && [tmp.path isEqual: @"/bar"] && [tmp.string isEqual: @"file://foo/bar"] && [tmp.fileSystemRepresentation isEqual: @"\\\\foo\\bar"] && (tmp = [OFURL fileURLWithPath: @"\\\\test"]) && [tmp.host isEqual: @"test"] && [tmp.path isEqual: @"/"] && [tmp.string isEqual: @"file://test/"] && [tmp.fileSystemRepresentation isEqual: @"\\\\test"]) # endif #endif TEST(@"-[string]", [[u1 string] isEqual: url_str] && [[u2 string] isEqual: @"http://foo:80"] && [[u3 string] isEqual: @"http://bar/"] && [[u4 string] isEqual: @"file:///etc/passwd"]) |
︙ | ︙ | |||
124 125 126 127 128 129 130 | [[u1 path] isEqual: @"/pa?th"] && [[u4 path] isEqual: @"/etc/passwd"]) TEST(@"-[pathComponents]", [[u1 pathComponents] isEqual: [OFArray arrayWithObjects: @"", @"pa?th", nil]] && [[u4 pathComponents] isEqual: [OFArray arrayWithObjects: @"", @"etc", @"passwd", nil]]) | | | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | [[u1 path] isEqual: @"/pa?th"] && [[u4 path] isEqual: @"/etc/passwd"]) TEST(@"-[pathComponents]", [[u1 pathComponents] isEqual: [OFArray arrayWithObjects: @"", @"pa?th", nil]] && [[u4 pathComponents] isEqual: [OFArray arrayWithObjects: @"", @"etc", @"passwd", nil]]) TEST(@"-[lastPathComponent]", [[[OFURL URLWithString: @"http://host/foo//bar/baz"] lastPathComponent] isEqual: @"baz"] && [[[OFURL URLWithString: @"http://host/foo//bar/baz/"] lastPathComponent] isEqual: @"baz"] && [[[OFURL URLWithString: @"http://host/foo/"] lastPathComponent] isEqual: @"foo"] && [[[OFURL URLWithString: @"http://host/"] |
︙ | ︙ |