diff --git a/doc-coverage/export-lists.rkt b/doc-coverage/export-lists.rkt index 2100335..2ac6034 100644 --- a/doc-coverage/export-lists.rkt +++ b/doc-coverage/export-lists.rkt @@ -22,15 +22,84 @@ (define (has-docs? mod binding) (not (not (xref-binding->definition-tag xref (list mod binding) #f)))) +(module+ test + (check-true (has-docs? 'racket/list 'second)) + (check-false (has-docs? 'racket/match 'match-...-nesting))) + (define (module->all-exported-names mod) (let-values ([(exp-values exp-syntax) (module->exports mod)]) (append (phase-exports->names exp-values) (phase-exports->names exp-syntax)))) +(module+ test + (check-equal? (module->all-exported-names 'racket/match) + '(legacy-match-expander? + match-...-nesting + match-expander? + prop:legacy-match-expander + prop:match-expander + syntax-local-match-introduce + exn:misc:match? + match-equality-test + match-define-values + define-match-expander + match + define/match + match*/derived + match/derived + match/values + match-letrec + match-define + match-let*-values + match-let-values + match-let* + match-let + match-lambda** + match-lambda + match* + failure-cont + == + struct* + match-lambda*))) + (define (module->documented-exported-names mod) (filter (curry has-docs? mod) (module->all-exported-names mod))) +(module+ test + (check-equal? (module->documented-exported-names 'racket/match) + '(legacy-match-expander? + match-expander? + prop:legacy-match-expander + prop:match-expander + syntax-local-match-introduce + exn:misc:match? + match-equality-test + match-define-values + define-match-expander + match + define/match + match*/derived + match/derived + match/values + match-letrec + match-define + match-let*-values + match-let-values + match-let* + match-let + match-lambda** + match-lambda + match* + failure-cont + == + struct* + match-lambda*))) + (define (module->undocumented-exported-names mod) (filter-not (curry has-docs? mod) (module->all-exported-names mod))) + +(module+ test + (check-equal? (module->undocumented-exported-names 'racket/match) + '(match-...-nesting))) \ No newline at end of file