diff --git a/pkgs/racket-test/tests/zo-path.rkt b/pkgs/racket-test/tests/zo-path.rkt index 8e3cdf56eb..e211ea2600 100644 --- a/pkgs/racket-test/tests/zo-path.rkt +++ b/pkgs/racket-test/tests/zo-path.rkt @@ -1,6 +1,8 @@ #lang racket (require setup/dirs) +(provide check-one) + ;; Paths from the build location shouldn't show up in bytecode files ;; or documentation. Check ".zo", ".dep", and ".html" files in the ;; build on the assumption that the first three elements of the @@ -11,26 +13,26 @@ (regexp-quote (path->bytes (apply build-path - (take (explode-path (find-collects-dir)) + (take (explode-path (find-collects-dir)) 3)))))) -(define (check-content rx:name) - (lambda (name kind v) - (when (regexp-match? rx:name name) - (call-with-input-file* name - (lambda (in) - (when (regexp-match? rx:dir in) - (eprintf "Found ~s in ~s\n" rx:dir name))))))) +(define (check-one file) + (call-with-input-file* + file + (lambda (in) + (when (regexp-match? rx:dir in) + (eprintf "Found ~s in ~s\n" rx:dir file))))) -(fold-files (check-content #rx"[.](?:zo|dep)$") - (void) - (find-collects-dir)) +(define ((check-content rx:name) name kind v) + (when (regexp-match? rx:name name) + (check-one name))) -(fold-files (check-content #rx"[.](?:zo|dep)$") - (void) - (find-pkgs-dir)) +(module+ main + (fold-files (check-content #rx"[.](?:zo|dep)$") + (void) + (find-pkgs-dir)) -;; Check rendered docs, too: -(fold-files (check-content #rx"[.](?:html)$") - (void) - (find-doc-dir)) + ;; Check rendered docs, too: + (fold-files (check-content #rx"[.](?:html)$") + (void) + (find-doc-dir)))