From eb122c52d28fd8a933897b13b35da21d40a9f415 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 22 Nov 2011 00:34:06 +0000 Subject: Fix cookie expiration svn path=/trunk/netsurf/; revision=13161 --- test/urldbtest.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/urldbtest.c') diff --git a/test/urldbtest.c b/test/urldbtest.c index 3de24f3be..396735f7c 100644 --- a/test/urldbtest.c +++ b/test/urldbtest.c @@ -247,6 +247,12 @@ int main(void) assert(urldb_set_cookie("foo=bar; domain=.example.tld\r\n", "http://www.foo.example.tld/", "http://bar.example.tld/")); assert(strcmp(urldb_get_cookie("http://www.foo.example.tld/"), "foo=bar") == 0); + /* Test expiry */ + assert(urldb_set_cookie("foo=bar", "http://expires.com/", NULL)); + assert(strcmp(urldb_get_cookie("http://expires.com/"), "foo=bar") == 0); + assert(urldb_set_cookie("foo=bar; expires=Thu, 01-Jan-1970 00:00:01 GMT\r\n", "http://expires.com/", NULL)); + assert(urldb_get_cookie("http://expires.com/") == NULL); + urldb_dump(); printf("PASS\n"); -- cgit v1.2.3