New tests

svn: r6520
This commit is contained in:
Jay McCarthy 2007-06-07 18:45:54 +00:00
parent cf4225b767
commit 9641bacc50
3 changed files with 42 additions and 5 deletions

View File

@ -17,4 +17,12 @@
"Default configuration file may be written"
(check-not-false (write-configuration-table
(read-configuration-table default-configuration-table-path)
(make-temporary-file)))))))
(make-temporary-file))))
(test-case
"Default configuration file may be converted to sexpr and back"
(check-not-false
(sexpr->configuration-table
(configuration-table->sexpr
(read-configuration-table
default-configuration-table-path))))))))

View File

@ -1,8 +1,37 @@
(module cache-table-test mzscheme
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2)))
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2))
(lib "cache-table.ss" "web-server" "private"))
(provide cache-table-tests)
; XXX
(define cache-table-tests
(test-suite
"Cache Table")))
"Cache Table"
(test-case
"Can construct cache-table"
(check-not-false (make-cache-table)))
(test-case
"make-cache-table returns cache-table?"
(check-true (cache-table? (make-cache-table))))
(test-case
"cache-table? does not recognize hash-tables"
(check-false (cache-table? (make-hash-table))))
(test-case
"cache-table-lookup: simple"
(check-true (cache-table-lookup! (make-cache-table) 'foo (lambda () #t))))
(test-case
"cache-table-lookup: complicated"
(check-true (let ([ct (make-cache-table)])
(cache-table-lookup! ct 'foo (lambda () #t))
(cache-table-lookup! ct 'foo (lambda () #f)))))
(test-case
"cache-table-clear! is effective"
(check-false (let ([ct (make-cache-table)])
(cache-table-lookup! ct 'foo (lambda () #t))
(cache-table-clear! ct)
(cache-table-lookup! ct 'foo (lambda () #f))))))))

View File

@ -39,7 +39,7 @@
; XXX
(define request-tests
(test-suite
"Request Parsing"
"HTTP Requests"
(test-suite
"Bindings"
(test-equal? "simple test 1"