fixed -c error

Closes #1.
This commit is contained in:
Spencer Florence 2015-04-28 18:53:30 -04:00 committed by Sam Tobin-Hochstadt
parent 12927d0e8b
commit db250c4cf9
3 changed files with 12 additions and 0 deletions

View File

@ -637,8 +637,12 @@
(module paths racket/base (module paths racket/base
(require setup/link (require setup/link
racket/match racket/match
setup/collection-name
raco/command-name
racket/list) racket/list)
(define test-exe-name (string->symbol (short-program+command-name)))
(struct col (name path) #:transparent) (struct col (name path) #:transparent)
(define (get-linked file user? version?) (define (get-linked file user? version?)
@ -681,6 +685,8 @@
;; This should be in Racket somewhere and return all the collection ;; This should be in Racket somewhere and return all the collection
;; paths, rather than just the first as collection-path does. ;; paths, rather than just the first as collection-path does.
(define (collection-paths c) (define (collection-paths c)
(when (not (collection-name? c))
(error test-exe-name "not a collection name in: ~a" c))
(match-define (list-rest sc more) (map path->string (explode-path c))) (match-define (list-rest sc more) (map path->string (explode-path c)))
(append* (append*
(for/list ([col (all-collections)] (for/list ([col (all-collections)]

View File

@ -9,6 +9,7 @@
(define pkg-authors '(mflatt)) (define pkg-authors '(mflatt))
(define build-deps '("compiler-lib" (define build-deps '("compiler-lib"
"eli-tester" "eli-tester"
"rackunit-lib"
"net-lib" "net-lib"
"scheme-lib" "scheme-lib"
"compatibility-lib" "compatibility-lib"

View File

@ -0,0 +1,5 @@
#lang racket
(require rackunit)
(require (only-in (submod compiler/commands/test paths) collection-paths))
(check-exn exn? (lambda () (collection-paths ".")))