diff --git a/collects/tests/typed-scheme/optimizer/run.rkt b/collects/tests/typed-scheme/optimizer/run.rkt index 6edd366d..4e8a6a2e 100644 --- a/collects/tests/typed-scheme/optimizer/run.rkt +++ b/collects/tests/typed-scheme/optimizer/run.rkt @@ -26,12 +26,23 @@ (define (test gen) (let-values (((base name _) (split-path gen))) (or (regexp-match ".*~" name) ; we ignore backup files - (equal? (parameterize ([current-load-relative-directory - (build-path here "generic")]) - (read-and-expand gen)) - (let ((hand-opt-dir (build-path here "hand-optimized"))) - (parameterize ([current-load-relative-directory hand-opt-dir]) - (read-and-expand (build-path hand-opt-dir name))))) + ;; machine optimized and hand optimized versions must expand to the + ;; same code + (and (equal? (parameterize ([current-load-relative-directory + (build-path here "generic")]) + (read-and-expand gen)) + (let ((hand-opt-dir (build-path here "hand-optimized"))) + (parameterize ([current-load-relative-directory hand-opt-dir]) + (read-and-expand (build-path hand-opt-dir name))))) + ;; optimized and non-optimized versions must evaluate to the + ;; same thing + (equal? (with-output-to-string + (lambda () + (dynamic-require gen #f))) + (with-output-to-string + (lambda () + (let ((non-opt-dir (build-path here "non-optimized"))) + (dynamic-require (build-path non-opt-dir name) #f)))))) (begin (printf "~a failed\n\n" name) #f))))