- with-test-server server-thunk tests-thunkprocedure
Start the server by executing server-thunk, run the tests (tests-thunk) and stop the server.
The awful application to be tested:
(use awful) (define-page "/foo" (lambda () "foo") no-template: #t)
The test program:
(use server-test awful http-client test) ;; The awful application to be tested (awful-apps (list "foo.scm")) (with-test-server (lambda () (awful-start (lambda () (load-apps (awful-apps))))) (lambda () (test "foo" (with-input-from-request "http://localhost:8080/foo" #f read-string))))