safer contract and docs

This commit is contained in:
Spencer Florence 2015-02-14 20:34:43 -05:00
parent 4986abc0ab
commit 6e77ba5b12
2 changed files with 16 additions and 7 deletions

View File

@ -1,6 +1,7 @@
#lang racket/base #lang racket/base
(require "cover.rkt" "format.rkt" "private/contracts.rkt" "private/format-utils.rkt" (require "cover.rkt" "format.rkt" "private/contracts.rkt" "private/format-utils.rkt"
"private/raw.rkt" racket/contract) "private/raw.rkt" racket/contract)
(provide (provide
(contract-out (contract-out
[coverage/c contract?] [coverage/c contract?]
@ -8,8 +9,9 @@
[test-files! (->* () (#:submod symbol?) [test-files! (->* () (#:submod symbol?)
#:rest #:rest
(listof (or/c path-string? (listof (or/c path-string?
(list/c path-string? (vectorof string? (list/c path-string?
#:immutable #t)))) (and/c (lambda (v) (not (impersonator? v)))
(vectorof string? #:immutable #t)))))
any)] any)]
[clear-coverage! (-> any)] [clear-coverage! (-> any)]
[get-test-coverage (-> coverage/c)] [get-test-coverage (-> coverage/c)]

View File

@ -26,12 +26,19 @@ removed during macro expansion and are thus neither run or not run.
Note that the @racket[srcloc]s are one indexed, meaning a @racket[1] Note that the @racket[srcloc]s are one indexed, meaning a @racket[1]
represents the first character in the file.} represents the first character in the file.}
@defproc[(test-files! (#:submod submod symbol? 'test) (files path-string?) ...) any]{ @defproc[(test-files! (#:submod submod symbol? 'test)
(files (or/c path-string?
(list/c path-string
(and/c (negate impersonator?)
(vectorof string? #:immutable #t))))) ...)
any]{
Runs all given @racket[files] and their submodule @racket[submod] (if it exists), storing the coverage information. Runs all given @racket[files] and their submodule @racket[submod] (if it exists), storing the
The function returns false if any tests fail. coverage information. If the path is paired with a vector then that vector is used as the
Test coverage information is still collected when test fail. @racket[current-command-line-arguments] when executing that file. This vector must be immuatable and
Test coverage info is added to existing coverage info.} not wrapped by a @racket[chaperone] or @racket[impersonator]. The function returns false if any
tests fail. Test coverage information is still collected when test fail. Test coverage info is
added to existing coverage info.}
@defproc[(clear-coverage!) any]{Clears all coverage information.} @defproc[(clear-coverage!) any]{Clears all coverage information.}