From f26c1c33dfc38d65605d3c3058e39743fde3b4be Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Tue, 12 Jun 2007 15:33:29 +0000 Subject: [PATCH] web.ss tests svn: r6598 --- collects/web-server/tests/servlet/web-test.ss | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/collects/web-server/tests/servlet/web-test.ss b/collects/web-server/tests/servlet/web-test.ss index f3c22f7cd5..8a6396a76d 100644 --- a/collects/web-server/tests/servlet/web-test.ss +++ b/collects/web-server/tests/servlet/web-test.ss @@ -1,20 +1,29 @@ (module web-test mzscheme (require (planet "test.ss" ("schematics" "schemeunit.plt" 2)) + (lib "url.ss" "net") (lib "web.ss" "web-server" "servlet")) (provide web-tests) + (define url0 (string->url "http://test.com/servlets/example.ss")) + (define web-tests (test-suite "Web" (test-suite - "continuation-url?" - ) - - (test-suite - "embed-ids" - ) + "continuation-url? and embed-ids" + (test-false "not k-url" (continuation-url? url0)) + (test-equal? "identity" + (continuation-url? (string->url (embed-ids (list 1 2 3) url0))) + (list 1 2 3))) (test-suite "xexpr/callback->xexpr" - )))) \ No newline at end of file + + (test-equal? "Simple" + (xexpr/callback->xexpr + (lambda _ "#") + `(html (head (title "Hello!")) + (body (a ([href ,(lambda (request) "Hey!")]) "A link")))) + `(html (head (title "Hello!")) + (body (a ([href "#"]) "A link")))))))) \ No newline at end of file