Changeset 9825 in project


Ignore:
Timestamp:
03/16/08 21:45:29 (12 years ago)
Author:
sjamaan
Message:

Add a few HTTP/1.1 tests

Location:
release/3/spiffy/trunk/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/3/spiffy/trunk/tests/setup.scm

    r9809 r9825  
    5555
    5656(define (fetch-file file host . rest)
    57   (let-optionals rest ((reader read-string))
    58     (let* ((req (http:make-request 'GET (sprintf "http://127.0.0.1:~A/~A" port file) `(("HOST" . ,host)))))
     57  (let-optionals rest ((reader read-string)
     58                       (protocol 'HTTP/1.0))
     59    (let* ((req (http:make-request 'GET (sprintf "http://127.0.0.1:~A/~A" port file) `(("HOST" . ,host)) '() "" protocol)))
    5960      (receive (first-line headers in out)
    6061               (http:send-request req)
  • release/3/spiffy/trunk/tests/spiffy-base-test.scm

    r9810 r9825  
    6565(test "directory listing denied" `(403 ,ERROR) (fetch-file "pics" "testhost"))
    6666(test "index page" `(200 ,index.html) (fetch-file "" "testhost"))
     67(test "HTTP 1.1" `(200 ,index.html) (fetch-file "index.html" "testhost" read-string 'HTTP/1.1))
     68(test "HTTP 1.1 404" `(404 ,ERROR) (fetch-file "bogus" "testhost" read-string 'HTTP/1.1))
    6769(test-end "static file serving")
    6870
     
    7880(test "redirect location" "/move-along" (header-ref "location" (get-headers "blah" "redirect-host")))
    7981(test "internal error" `(500 ,EXN) (fetch-file "cause-error" "error-host"))
     82(test "HTTP/1.1 internal error" `(500 ,EXN) (fetch-file "cause-error" "error-host" read-string 'HTTP/1.1))
    8083(test-end "miscellaneous")
    8184
    8285(test-begin "resources")
    83 (test "ok resource" `(200 "Everything's cool") (fetch-file "ok-resource" "localhost"))
    84 (test "ok resource, using respond binding" `(200 "Everything's cool") (fetch-file "ok-respond-resource" "localhost"))
    85 (test "error resource" `(500 ,EXN) (fetch-file "error-resource" "localhost"))
    86 (test "error resource, using respond binding" `(500 "Not ok") (fetch-file "error-respond-resource" "localhost"))
     86(test "ok resource" `(200 "Everything's cool") (fetch-file "ok-resource" "testhost"))
     87(test "ok resource, using respond binding" `(200 "Everything's cool") (fetch-file "ok-respond-resource" "testhost"))
     88(test "error resource" `(500 ,EXN) (fetch-file "error-resource" "testhost"))
     89(test "error resource, using respond binding" `(500 "Not ok") (fetch-file "error-respond-resource" "testhost"))
     90(test "HTTP 1.1 resource" `(200 "Everything's cool") (fetch-file "ok-resource" "testhost" read-string 'HTTP/1.1))
     91(test "HTTP 1.1 error resource" `(500 ,EXN) (fetch-file "error-resource" "testhost" read-string 'HTTP/1.1))
    8792(test-end "resources")
Note: See TracChangeset for help on using the changeset viewer.