From badd40e5f5af51221c69e8c54b773ffc89a2f6b8 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Tue, 2 Jul 2013 16:02:00 -0400 Subject: [PATCH] Don't run special sandbox tests when the relevant libs are not available. --- .../racket-test/tests/racket/sandbox.rktl | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/sandbox.rktl b/pkgs/racket-pkgs/racket-test/tests/racket/sandbox.rktl index 2e8417264d..73684a084f 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/sandbox.rktl +++ b/pkgs/racket-pkgs/racket-test/tests/racket/sandbox.rktl @@ -464,23 +464,6 @@ ;; languages and requires --top-- - (make-evaluator! '(special r5rs) "(define x (eq? 'x 'X))") - --eval-- - x => #t - --top-- - (make-base-evaluator! "(define l null)") - --eval-- - (cond [null? l 0]) => 0 - (last-pair l) =err> "last-pair: undefined" - --top-- - (make-evaluator! '(special beginner) - (make-prog "(define l null)" "(define x 3.5)")) - --eval-- - (cond [null? l 0]) =err> "no open parenthesis" - --top-- - (eq? (ev "6") (ev "(sub1 (* 2 3.5))")) - (eq? (ev "6") (ev "(sub1 (* 2 x))")) - --top-- (make-base-evaluator/reqs! '(racket/list)) --eval-- (last-pair '(1 2 3)) => '(3) @@ -596,7 +579,34 @@ --top-- (getenv "PEAR") => #f - )) + ;; tests for specials + --top-- + ;; these are conditional so that we can run + ;; the tests even when htdp or r5rs is not available + (when (collection-file-path "lang.rkt" "r5rs" #:fail (lambda (s) #f)) + (t + --top-- + (make-evaluator! '(special r5rs) "(define x (eq? 'x 'X))") + --eval-- + x => #t + --top-- + (make-base-evaluator! "(define l null)") + --eval-- + (cond [null? l 0]) => 0 + (last-pair l) =err> "last-pair: undefined")) + + (when (collection-file-path "htdp-beginner.rkt" "lang" #:fail (lambda (s) #f)) + (t + --top-- + (make-evaluator! '(special beginner) + (make-prog "(define l null)" "(define x 3.5)")) + --eval-- + (cond [null? l 0]) =err> "no open parenthesis" + --top-- + (eq? (ev "6") (ev "(sub1 (* 2 3.5))")) + (eq? (ev "6") (ev "(sub1 (* 2 x))")))))) + + (parameterize ([current-module-declare-name (make-resolved-module-path 'junk)]) (define (avoid-module-declare-name)