From e8a0a26c2f4b3f8da6beb0b3a6b7348d6cfeccf9 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 2 Jul 2010 19:35:33 -0400 Subject: [PATCH] Changed the optimizer's test harness to ignore type tables. --- collects/tests/typed-scheme/optimizer/run.rkt | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/collects/tests/typed-scheme/optimizer/run.rkt b/collects/tests/typed-scheme/optimizer/run.rkt index 97f575c1a2..b4139e25c6 100644 --- a/collects/tests/typed-scheme/optimizer/run.rkt +++ b/collects/tests/typed-scheme/optimizer/run.rkt @@ -5,17 +5,22 @@ ;; we compare the expansion of automatically optimized and hand optimized ;; modules (define (read-and-expand file) - ;; drop the "module", its name and its language, so that we can write the - ;; 2 versions of each test in different languages (typed and untyped) if - ;; need be - (cdddr - (syntax->datum - (parameterize ([current-namespace (make-base-namespace)]) - (with-handlers - ([exn:fail? (lambda (exn) - (printf "~a\n" (exn-message exn)) - #'(#f #f #f #f))]) ; for cdddr - (expand (with-input-from-file file read-syntax))))))) + ;; drop the type tables added by typed scheme, since they can be in a + ;; different order each time, and that would make tests fail when they + ;; shouldn't + (filter + ;; drop the "module", its name and its language, so that we can write + ;; the 2 versions of each test in different languages (typed and + ;; untyped) if need be + (match-lambda [(list 'define-values-for-syntax '() _ ...) #f] [_ #t]) + (cadddr + (syntax->datum + (parameterize ([current-namespace (make-base-namespace)]) + (with-handlers + ([exn:fail? (lambda (exn) + (printf "~a\n" (exn-message exn)) + #'(#f #f #f (#f)))]) ; for cadddr + (expand (with-input-from-file file read-syntax)))))))) (define (test gen) (let-values (((base name _) (split-path gen)))