From db250c4cf9cbebf374699ced3e81bfa43b6a59e2 Mon Sep 17 00:00:00 2001 From: Spencer Florence Date: Tue, 28 Apr 2015 18:53:30 -0400 Subject: [PATCH] fixed -c error Closes #1. --- compiler-lib/compiler/commands/test.rkt | 6 ++++++ compiler-test/info.rkt | 1 + compiler-test/tests/compiler/commands/test.rkt | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 compiler-test/tests/compiler/commands/test.rkt diff --git a/compiler-lib/compiler/commands/test.rkt b/compiler-lib/compiler/commands/test.rkt index e0c7e342b2..7416398815 100644 --- a/compiler-lib/compiler/commands/test.rkt +++ b/compiler-lib/compiler/commands/test.rkt @@ -637,8 +637,12 @@ (module paths racket/base (require setup/link racket/match + setup/collection-name + raco/command-name racket/list) + (define test-exe-name (string->symbol (short-program+command-name))) + (struct col (name path) #:transparent) (define (get-linked file user? version?) @@ -681,6 +685,8 @@ ;; This should be in Racket somewhere and return all the collection ;; paths, rather than just the first as collection-path does. (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))) (append* (for/list ([col (all-collections)] diff --git a/compiler-test/info.rkt b/compiler-test/info.rkt index 225508f53c..a39c4d12de 100644 --- a/compiler-test/info.rkt +++ b/compiler-test/info.rkt @@ -9,6 +9,7 @@ (define pkg-authors '(mflatt)) (define build-deps '("compiler-lib" "eli-tester" + "rackunit-lib" "net-lib" "scheme-lib" "compatibility-lib" diff --git a/compiler-test/tests/compiler/commands/test.rkt b/compiler-test/tests/compiler/commands/test.rkt new file mode 100644 index 0000000000..62dbe1dbc7 --- /dev/null +++ b/compiler-test/tests/compiler/commands/test.rkt @@ -0,0 +1,5 @@ +#lang racket +(require rackunit) +(require (only-in (submod compiler/commands/test paths) collection-paths)) + +(check-exn exn? (lambda () (collection-paths ".")))