Differences From Artifact [b43f4c978f]:
- File
tests/OFURLTests.m
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 3199) [annotate] [blame] [check-ins using]
To Artifact [26f206153b]:
- File
tests/OFURLTests.m
— part of check-in
[0f995db06d]
at
2017-10-28 21:08:37
on branch trunk
— Make OFURL more generic
This removes the special handling dependent on the scheme. (user: js, size: 3260) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
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" #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFInvalidFormatException.h" #import "TestsAppDelegate.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 "OFNumber.h" #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFInvalidFormatException.h" #import "TestsAppDelegate.h" |
︙ | ︙ | |||
51 52 53 54 55 56 57 | 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"]) TEST(@"-[string]", [[u1 string] isEqual: url_str] && | | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | 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"]) TEST(@"-[string]", [[u1 string] isEqual: url_str] && [[u2 string] isEqual: @"http://foo:80"] && [[u3 string] isEqual: @"http://bar/"] && [[u4 string] isEqual: @"file:///etc/passwd"]) TEST(@"-[scheme]", [[u1 scheme] isEqual: @"ht%3atp"] && [[u4 scheme] isEqual: @"file"]) TEST(@"-[user]", [[u1 user] isEqual: @"us%3Aer"] && [u4 user] == nil) 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) |
︙ | ︙ |