From dd2a12aab6c5794dd90a0db4d02e8a87cfc366a5 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Sun, 7 May 2017 15:03:14 -0500 Subject: [PATCH] Repair id cookie test --- .../tests/web-server/http/cookies-test.rkt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/web-server-test/tests/web-server/http/cookies-test.rkt b/web-server-test/tests/web-server/http/cookies-test.rkt index 364cfe37..20bd6025 100644 --- a/web-server-test/tests/web-server/http/cookies-test.rkt +++ b/web-server-test/tests/web-server/http/cookies-test.rkt @@ -313,12 +313,23 @@ #:name "my-id-cookie" #:key test-secret-salt #:timeout 1089023629)) + (test-equal? "long finite shelf-life / fresh cookie" + (valid-id-cookie? (make-id-cookie "fresh-id-cookie" + "test-value" + #:key #"test-key") + #:name "fresh-id-cookie" + #:key #"test-key" + #:shelf-life 500 + ) + "test-value") (test-equal? "long finite shelf-life" (request-id-cookie req #:name "my-id-cookie" #:key test-secret-salt - #:shelf-life 500) - "test-value") + #:shelf-life (+ 10 + (- (current-seconds) + 1489023629))) + "my-signed-value") (test-false "shelf-life / reject expired" (request-id-cookie req #:name "my-id-cookie"