mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Fix NSURLRequest test
We can't use parameters containing commas in macros.
This commit is contained in:
parent
fd7f11a134
commit
3b3687afb3
1 changed files with 7 additions and 9 deletions
|
@ -8,6 +8,7 @@ int main()
|
|||
NSURLRequest *request;
|
||||
NSMutableURLRequest *mutable;
|
||||
NSURL *httpURL, *foobarURL;
|
||||
NSDictionary *expected;
|
||||
|
||||
httpURL = [NSURL URLWithString: @"http://www.gnustep.org"];
|
||||
foobarURL = [NSURL URLWithString: @"foobar://localhost/madeupscheme"];
|
||||
|
@ -44,17 +45,14 @@ int main()
|
|||
PASS_EQUAL([mutable valueForHTTPHeaderField: @"gnustep"], (@"value1,value2"),
|
||||
"Handle multiple values for an HTTP header field");
|
||||
[mutable setAllHTTPHeaderFields: [NSDictionary dictionaryWithObject: @"object" forKey: @"key"]];
|
||||
PASS_EQUAL([mutable allHTTPHeaderFields],
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:@"object", @"key", @"value1,value2", @"gnustep", nil],
|
||||
"setAllHTTPHeaderFields adds header");
|
||||
expected = [NSDictionary dictionaryWithObjectsAndKeys:@"object", @"key", @"value1,value2", @"gnustep", nil];
|
||||
PASS_EQUAL([mutable allHTTPHeaderFields], expected, "setAllHTTPHeaderFields adds header");
|
||||
[mutable setValue: @"value3" forHTTPHeaderField: @"gnustep"];
|
||||
PASS_EQUAL([mutable allHTTPHeaderFields],
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:@"object", @"key", @"value3", @"gnustep", nil],
|
||||
"Update header field");
|
||||
expected = [NSDictionary dictionaryWithObjectsAndKeys:@"object", @"key", @"value3", @"gnustep", nil];
|
||||
PASS_EQUAL([mutable allHTTPHeaderFields], expected, "Update header field");
|
||||
[mutable setValue: nil forHTTPHeaderField: @"gnustep"];
|
||||
PASS_EQUAL([mutable allHTTPHeaderFields],
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:@"object", @"key", nil],
|
||||
"Remove header field");
|
||||
expected = [NSDictionary dictionaryWithObjectsAndKeys:@"object", @"key", nil];
|
||||
PASS_EQUAL([mutable allHTTPHeaderFields], expected, "Remove header field");
|
||||
[mutable release];
|
||||
|
||||
mutable = [NSMutableURLRequest new];
|
||||
|
|
Loading…
Reference in a new issue