Differences From Artifact [db6e110ccc]:
- File tests/OFHTTPCookieManagerTests.m — part of check-in [28bacc2aa0] at 2017-05-14 21:29:48 on branch trunk — Add OFHTTPCookieManager (user: js, size: 3627) [annotate] [blame] [check-ins using]
To Artifact [0cc34f9e4e]:
- File
tests/OFHTTPCookieManagerTests.m
— part of check-in
[f36f9bed02]
at
2017-05-15 21:35:12
on branch trunk
— OFHTTPCookie: Make domain and path mandatory
This requires passing a domain and defaults the path to /. (user: js, size: 3730) [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 "OFHTTPCookieManager.h" #import "OFHTTPCookie.h" #import "OFURL.h" #import "OFAutoreleasePool.h" #import "TestsAppDelegate.h" static OFString *module = @"OFHTTPCookieManager"; | > > | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #import "OFHTTPCookieManager.h" #import "OFArray.h" #import "OFDate.h" #import "OFHTTPCookie.h" #import "OFURL.h" #import "OFAutoreleasePool.h" #import "TestsAppDelegate.h" static OFString *module = @"OFHTTPCookieManager"; |
︙ | ︙ | |||
35 36 37 38 39 40 41 | URL[0] = [OFURL URLWithString: @"http://heap.zone/foo"]; URL[1] = [OFURL URLWithString: @"https://heap.zone/foo/bar"]; URL[2] = [OFURL URLWithString: @"https://test.heap.zone/foo/bar"]; URL[3] = [OFURL URLWithString: @"http://webkeks.org/foo/bar"]; cookie[0] = [OFHTTPCookie cookieWithName: @"test" | | > | | | > | > | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | URL[0] = [OFURL URLWithString: @"http://heap.zone/foo"]; URL[1] = [OFURL URLWithString: @"https://heap.zone/foo/bar"]; URL[2] = [OFURL URLWithString: @"https://test.heap.zone/foo/bar"]; URL[3] = [OFURL URLWithString: @"http://webkeks.org/foo/bar"]; cookie[0] = [OFHTTPCookie cookieWithName: @"test" value: @"1" domain: @"heap.zone"]; TEST(@"-[addCookie:forURL:] #1", R([manager addCookie: cookie[0] forURL: URL[0]])) TEST(@"-[cookiesForURL:] #1", [[manager cookiesForURL: URL[0]] isEqual: [OFArray arrayWithObject: cookie[0]]]) cookie[1] = [OFHTTPCookie cookieWithName: @"test" value: @"2" domain: @"webkeks.org"]; TEST(@"-[addCookie:forURL:] #2", R([manager addCookie: cookie[1] forURL: URL[0]])) TEST(@"-[cookiesForURL:] #2", [[manager cookiesForURL: URL[0]] isEqual: [OFArray arrayWithObject: cookie[0]]] && [[manager cookiesForURL: URL[3]] isEqual: [OFArray array]]) cookie[2] = [OFHTTPCookie cookieWithName: @"test" value: @"3" domain: @"heap.zone"]; [cookie[2] setSecure: true]; TEST(@"-[addCookie:forURL:] #3", R([manager addCookie: cookie[2] forURL: URL[1]])) TEST(@"-[cookiesForURL:] #3", [[manager cookiesForURL: URL[1]] isEqual: [OFArray arrayWithObject: cookie[2]]] && [[manager cookiesForURL: URL[0]] isEqual: [OFArray array]]) [cookie[2] setExpires: [OFDate dateWithTimeIntervalSinceNow: -1]]; cookie[3] = [OFHTTPCookie cookieWithName: @"test" value: @"4" domain: @"heap.zone"]; [cookie[3] setDomain: @".heap.zone"]; TEST(@"-[addCookie:forURL:] #4", R([manager addCookie: cookie[3] forURL: URL[1]])) TEST(@"-[cookiesForURL:] #4", [[manager cookiesForURL: URL[1]] isEqual: [OFArray arrayWithObject: cookie[3]]] && [[manager cookiesForURL: URL[2]] isEqual: [OFArray arrayWithObject: cookie[3]]]) cookie[4] = [OFHTTPCookie cookieWithName: @"bar" value: @"5" domain: @"test.heap.zone"]; TEST(@"-[addCookie:forURL:] #5", R([manager addCookie: cookie[4] forURL: URL[0]])) TEST(@"-[cookiesForURL:] #5", [[manager cookiesForURL: URL[0]] isEqual: [OFArray arrayWithObject: cookie[3]]] && [[manager cookiesForURL: URL[2]] isEqual: |
︙ | ︙ |