13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include "config.h"
#import "OFURL.h"
#ifdef OF_HAVE_FILES
# import "OFFileManager.h"
#endif
#import "OFNumber.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"
|
>
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include "config.h"
#import "OFURL.h"
#import "OFArray.h"
#ifdef OF_HAVE_FILES
# import "OFFileManager.h"
#endif
#import "OFNumber.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"
|
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
TEST(@"-[password]",
[[u1 password] isEqual: @"p%40w"] && [u4 password] == nil)
TEST(@"-[host]", [[u1 host] isEqual: @"ho%3Ast"] && [u4 port] == 0)
TEST(@"-[port]", [[u1 port] isEqual: [OFNumber numberWithUInt16: 1234]])
TEST(@"-[path]",
[[u1 path] isEqual: @"/pa%3Bth"] &&
[[u4 path] isEqual: @"/etc/passwd"])
TEST(@"-[parameters]",
[[u1 parameters] isEqual: @"pa%3Fram"] && [u4 parameters] == nil)
TEST(@"-[query]",
[[u1 query] isEqual: @"que%23ry"] && [u4 query] == nil)
TEST(@"-[fragment]",
[[u1 fragment] isEqual: @"frag%23ment"] && [u4 fragment] == nil)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
TEST(@"-[password]",
[[u1 password] isEqual: @"p%40w"] && [u4 password] == nil)
TEST(@"-[host]", [[u1 host] isEqual: @"ho%3Ast"] && [u4 port] == 0)
TEST(@"-[port]", [[u1 port] isEqual: [OFNumber numberWithUInt16: 1234]])
TEST(@"-[path]",
[[u1 path] isEqual: @"/pa%3Bth"] &&
[[u4 path] isEqual: @"/etc/passwd"])
TEST(@"-[pathComponents]",
[[u1 pathComponents] isEqual:
[OFArray arrayWithObjects: @"", @"pa%3Bth", 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/"]
lastPathComponent] isEqual: @""])
TEST(@"-[parameters]",
[[u1 parameters] isEqual: @"pa%3Fram"] && [u4 parameters] == nil)
TEST(@"-[query]",
[[u1 query] isEqual: @"que%23ry"] && [u4 query] == nil)
TEST(@"-[fragment]",
[[u1 fragment] isEqual: @"frag%23ment"] && [u4 fragment] == nil)
|