Differences From Artifact [9dd7664004]:
- File tests/OFURLTests.m — part of check-in [c1c9443c1a] at 2017-10-29 15:23:36 on branch trunk — OFURL: Properties store unencoded strings now (user: js, size: 4220) [annotate] [blame] [check-ins using]
To Artifact [96f3992920]:
- File
tests/OFURLTests.m
— part of check-in
[5f7305c659]
at
2017-10-31 21:39:36
on branch trunk
— OFURL: URL-encode according to RFC 3986
This also means the parameters go away and get folded into the path. (user: js, size: 4118) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
27 28 29 30 31 32 33 | #import "OFInvalidFormatException.h" #import "TestsAppDelegate.h" static OFString *module = @"OFURL"; static OFString *url_str = @"ht%3Atp://us%3Aer:p%40w@ho%3Ast:1234/" | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #import "OFInvalidFormatException.h" #import "TestsAppDelegate.h" static OFString *module = @"OFURL"; static OFString *url_str = @"ht%3Atp://us%3Aer:p%40w@ho%3Ast:1234/" @"pa%3Fth?que%23ry#frag%23ment"; @implementation TestsAppDelegate (OFURLTests) - (void)URLTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFURL *u1, *u2, *u3, *u4; |
︙ | ︙ | |||
76 77 78 79 80 81 82 | TEST(@"-[user]", [[u1 user] isEqual: @"us:er"] && [u4 user] == nil) TEST(@"-[password]", [[u1 password] isEqual: @"p@w"] && [u4 password] == nil) TEST(@"-[host]", [[u1 host] isEqual: @"ho:st"] && [u4 port] == 0) TEST(@"-[port]", [[u1 port] isEqual: [OFNumber numberWithUInt16: 1234]]) TEST(@"-[path]", | | | < < | 76 77 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(@"-[user]", [[u1 user] isEqual: @"us:er"] && [u4 user] == nil) TEST(@"-[password]", [[u1 password] isEqual: @"p@w"] && [u4 password] == nil) TEST(@"-[host]", [[u1 host] isEqual: @"ho:st"] && [u4 port] == 0) TEST(@"-[port]", [[u1 port] isEqual: [OFNumber numberWithUInt16: 1234]]) TEST(@"-[path]", [[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/"] lastPathComponent] isEqual: @""]) TEST(@"-[query]", [[u1 query] isEqual: @"que#ry"] && [u4 query] == nil) TEST(@"-[fragment]", [[u1 fragment] isEqual: @"frag#ment"] && [u4 fragment] == nil) TEST(@"-[copy]", R(u4 = [[u1 copy] autorelease])) |
︙ | ︙ |