Tests and bug fixes and notes
svn: r6524
This commit is contained in:
parent
0338d621eb
commit
bdd86a69e4
|
@ -46,6 +46,7 @@
|
||||||
empty
|
empty
|
||||||
#f))
|
#f))
|
||||||
|
|
||||||
|
;; XXX url->servlet, get rid of timeout, optional session manager
|
||||||
(define interface-version 'v1)
|
(define interface-version 'v1)
|
||||||
(define/kw (make #:key
|
(define/kw (make #:key
|
||||||
url->path
|
url->path
|
||||||
|
|
|
@ -14,9 +14,11 @@
|
||||||
(lambda (ps)
|
(lambda (ps)
|
||||||
(map (lambda (p/p)
|
(map (lambda (p/p)
|
||||||
(if (unbox first?)
|
(if (unbox first?)
|
||||||
(make-path/param (path/param-path p/p) empty)
|
(begin0 (make-path/param (path/param-path p/p) empty)
|
||||||
|
(set-box! first? #f))
|
||||||
p/p))
|
p/p))
|
||||||
ps)))))
|
ps))
|
||||||
|
in-url)))
|
||||||
(define (request->servlet-url req)
|
(define (request->servlet-url req)
|
||||||
(make-servlet-url (request-uri req)))
|
(make-servlet-url (request-uri req)))
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,29 @@
|
||||||
(module servlet-url-test mzscheme
|
(module servlet-url-test mzscheme
|
||||||
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2)))
|
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2))
|
||||||
|
(lib "list.ss")
|
||||||
|
(lib "url.ss" "net")
|
||||||
|
(lib "servlet-url.ss" "web-server" "servlet")
|
||||||
|
(lib "request-structs.ss" "web-server" "private"))
|
||||||
(provide servlet-url-tests)
|
(provide servlet-url-tests)
|
||||||
|
|
||||||
; XXX
|
|
||||||
(define servlet-url-tests
|
(define servlet-url-tests
|
||||||
(test-suite
|
(test-suite
|
||||||
"Servlet URLs")))
|
"Servlet URLs"
|
||||||
|
|
||||||
|
(test-case
|
||||||
|
"Basic"
|
||||||
|
(check-equal? (servlet-url->url-string/no-continuation
|
||||||
|
(request->servlet-url
|
||||||
|
(make-request 'get (string->url "http://localhost/servlets;1*1*65539753/examples/add.ss")
|
||||||
|
empty empty #f
|
||||||
|
"host" 80 "client")))
|
||||||
|
"http://localhost/servlets/examples/add.ss"))
|
||||||
|
|
||||||
|
(test-case
|
||||||
|
"Param"
|
||||||
|
(check-equal? (servlet-url->url-string/no-continuation
|
||||||
|
(request->servlet-url
|
||||||
|
(make-request 'get (string->url "http://localhost/servlets;1*1*65539753/examples/add.ss;foo")
|
||||||
|
empty empty #f
|
||||||
|
"host" 80 "client")))
|
||||||
|
"http://localhost/servlets/examples/add.ss;foo")))))
|
Loading…
Reference in New Issue
Block a user