From 41c9a2eaf17825f3af06ae16232cdd827f2864ea Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 7 Jul 2008 15:19:50 -0400 Subject: [PATCH] Fix exn-pred handling. --- collects/tests/typed-scheme/main.ss | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/collects/tests/typed-scheme/main.ss b/collects/tests/typed-scheme/main.ss index 520ac6a297..3a3d2fc77b 100644 --- a/collects/tests/typed-scheme/main.ss +++ b/collects/tests/typed-scheme/main.ss @@ -24,20 +24,22 @@ [(number? e) (and (exn:fail:syntax? val) (= e (length (exn:fail:syntax-exprs val))))] - [(or (string? e) (regexp? e) (bytes? e)) + [else (regexp-match e (exn-message val))])))) args)) (define (exn-pred p) (let ([sexp (with-handlers ([exn:fail? (lambda _ #f)]) - (with-input-from-file p - (lambda () - (read-line 'any) (read))))]) + (call-with-input-file + p + (lambda (prt) + (read-line prt 'any) (read prt))))]) (match sexp [(list-rest 'exn-pred e) (eval `(exn-matches . ,e) (namespace-anchor->namespace a))] - [_ (exn-matches ".*typecheck.*" exn:fail:syntax?)]))) + [_ + (exn-matches ".*typecheck.*" exn:fail:syntax?)]))) (define (mk-tests dir loader test) (lambda ()