Differences From Artifact [52cea266a3]:
- File
tests/OFURLTests.m
— part of check-in
[25c985fec1]
at
2020-08-25 00:11:24
on branch trunk
— OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long
long, these can be used instead. (user: js, size: 12037) [annotate] [blame] [check-ins using] [more...]
To Artifact [307ed6832b]:
- File tests/OFURLTests.m — part of check-in [a151f9c31f] at 2020-10-03 23:25:55 on branch trunk — OFURL: Add queryDictionary property (user: js, size: 12476) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
17 18 19 20 21 22 23 | #include "config.h" #import "TestsAppDelegate.h" static OFString *module = @"OFURL"; static OFString *url_str = @"ht%3atp://us%3Aer:p%40w@ho%3Ast:1234/" | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include "config.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=1&f%26oo=b%3dar#frag%23ment"; @implementation TestsAppDelegate (OFURLTests) - (void)URLTests { void *pool = objc_autoreleasePoolPush(); OFURL *u1, *u2, *u3, *u4, *u5, *u6, *u7; OFMutableURL *mu; |
︙ | ︙ | |||
174 175 176 177 178 179 180 | lastPathComponent] isEqual: @"baz"] && [[[OFURL URLWithString: @"http://host/foo/"] lastPathComponent] isEqual: @"foo"] && [[[OFURL URLWithString: @"http://host/"] lastPathComponent] isEqual: @"/"] && [u5.lastPathComponent isEqual: @"foo/bar"]) TEST(@"-[query]", | | > > > > | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | lastPathComponent] isEqual: @"baz"] && [[[OFURL URLWithString: @"http://host/foo/"] lastPathComponent] isEqual: @"foo"] && [[[OFURL URLWithString: @"http://host/"] lastPathComponent] isEqual: @"/"] && [u5.lastPathComponent isEqual: @"foo/bar"]) TEST(@"-[query]", [u1.query isEqual: @"que#ry=1&f&oo=b=ar"] && u4.query == nil) TEST(@"-[queryDictionary]", [u1.queryDictionary isEqual: [OFDictionary dictionaryWithKeysAndObjects: @"que#ry", @"1", @"f&oo", @"b=ar", nil]]); TEST(@"-[fragment]", [u1.fragment isEqual: @"frag#ment"] && u4.fragment == nil) TEST(@"-[copy]", R(u4 = [[u1 copy] autorelease])) TEST(@"-[isEqual:]", [u1 isEqual: u4] && ![u2 isEqual: u3] && [[OFURL URLWithString: @"HTTP://bar/"] isEqual: u3]) |
︙ | ︙ | |||
265 266 267 268 269 270 271 272 273 274 275 276 277 278 | (mu.URLEncodedQuery = @"que/ry?%23") && [mu.query isEqual: @"que/ry?#"]) EXPECT_EXCEPTION( @"-[setURLEncodedQuery:] with invalid characters fails", OFInvalidFormatException, mu.URLEncodedQuery = @"`") TEST(@"-[setFragment:]", (mu.fragment = @"frag/ment?#") && [mu.URLEncodedFragment isEqual: @"frag/ment?%23"]) TEST(@"-[setURLEncodedFragment:]", (mu.URLEncodedFragment = @"frag/ment?%23") && [mu.fragment isEqual: @"frag/ment?#"]) | > > > > > > | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | (mu.URLEncodedQuery = @"que/ry?%23") && [mu.query isEqual: @"que/ry?#"]) EXPECT_EXCEPTION( @"-[setURLEncodedQuery:] with invalid characters fails", OFInvalidFormatException, mu.URLEncodedQuery = @"`") TEST(@"-[setQueryDictionary:]", (mu.queryDictionary = [OFDictionary dictionaryWithKeysAndObjects: @"foo&bar", @"baz=qux", @"f=oobar", @"b&azqux", nil]) && [mu.URLEncodedQuery isEqual: @"foo%26bar=baz%3Dqux&f%3Doobar=b%26azqux"]) TEST(@"-[setFragment:]", (mu.fragment = @"frag/ment?#") && [mu.URLEncodedFragment isEqual: @"frag/ment?%23"]) TEST(@"-[setURLEncodedFragment:]", (mu.URLEncodedFragment = @"frag/ment?%23") && [mu.fragment isEqual: @"frag/ment?#"]) |
︙ | ︙ |