From ab9aad67839f0c0aa9248302b1c66d016aa95bfa Mon Sep 17 00:00:00 2001 From: Leif Andersen Date: Thu, 31 Dec 2015 11:36:42 -0700 Subject: [PATCH] Add some basic tests. --- doc-coverage/raco.rkt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc-coverage/raco.rkt b/doc-coverage/raco.rkt index e39a038..400618f 100644 --- a/doc-coverage/raco.rkt +++ b/doc-coverage/raco.rkt @@ -5,6 +5,11 @@ rackunit/docs-complete "main.rkt") +(module+ test + (require rackunit + rackunit/text-ui + compiler/find-exe)) + ; do-ignore! : (U string symbol) regex -> boolean (define (do-ignore! mod ignore) (error "Ignore not implemented yet") @@ -95,3 +100,18 @@ (when (error-on-exit?) (exit 1))) + +(module+ test + (check-equal? + (with-output-to-string + (lambda () (system* (find-exe) "-l" "raco" "doc-coverage" "racket/base"))) + "Module racket/base is missing documentation for: (expand-for-clause for-clause-syntax-protect syntax-pattern-variable?)\n") + (check-equal? + (with-output-to-string + (lambda () (system* (find-exe) "-l" "raco" "doc-coverage" "-r" "0.5" "racket/match"))) + "Module racket/match document ratio: 28/29\n") + (check-equal? + (with-output-to-string + (lambda () (system* (find-exe) "-l" "raco" "doc-coverage" "-b" "match" "racket"))) + "Module racket has documentation for match\n")) +