Add export-lists tests

This commit is contained in:
JackFirth 2015-02-22 20:43:12 -08:00
parent 9e38800eeb
commit 41d947ecf8

View File

@ -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)))