web.ss tests

svn: r6598
This commit is contained in:
Jay McCarthy 2007-06-12 15:33:29 +00:00
parent f4b6b79578
commit f26c1c33df

View File

@ -1,20 +1,29 @@
(module web-test mzscheme (module web-test mzscheme
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2)) (require (planet "test.ss" ("schematics" "schemeunit.plt" 2))
(lib "url.ss" "net")
(lib "web.ss" "web-server" "servlet")) (lib "web.ss" "web-server" "servlet"))
(provide web-tests) (provide web-tests)
(define url0 (string->url "http://test.com/servlets/example.ss"))
(define web-tests (define web-tests
(test-suite (test-suite
"Web" "Web"
(test-suite (test-suite
"continuation-url?" "continuation-url? and embed-ids"
) (test-false "not k-url" (continuation-url? url0))
(test-equal? "identity"
(test-suite (continuation-url? (string->url (embed-ids (list 1 2 3) url0)))
"embed-ids" (list 1 2 3)))
)
(test-suite (test-suite
"xexpr/callback->xexpr" "xexpr/callback->xexpr"
))))
(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"))))))))