add module-browser test (should have been included in 6949473b)

This commit is contained in:
Robby Findler 2014-04-10 14:25:04 -05:00
parent 6949473bf2
commit ab38f64e5b

View File

@ -0,0 +1,40 @@
#lang racket/base
(require racket/unit
racket/async-channel
drracket/private/module-browser
rackunit)
(define (fetch-files stx/fn)
(define progress-channel (make-async-channel))
(define connection-channel (make-async-channel))
(define-values/invoke-unit process-program-unit
(import process-program-import^)
(export process-program-export^))
(thread
(λ ()
(add-connections stx/fn)
(async-channel-put connection-channel #f)))
(let loop ()
(define next (sync connection-channel))
(cond
[next (cons next (loop))]
[else '()])))
(define r/b
(fetch-files
(collection-file-path "module-browser-test1.rkt" "tests" "drracket")))
(check-not-false (member (collection-file-path "base.rkt" "racket")
(map car r/b)))
(check-false (member (collection-file-path "list.rkt" "racket")
(map car r/b)))
(define r/b+submod
(fetch-files
(collection-file-path "module-browser-test2.rkt" "tests" "drracket")))
(check-not-false (member (collection-file-path "base.rkt" "racket")
(map car r/b+submod)))
(check-not-false (member (collection-file-path "list.rkt" "racket")
(map car r/b+submod)))