From 7e933ee8a4fac7944c12c921c9a361d97a3d2211 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Sun, 24 Jul 2011 12:19:05 -0400 Subject: [PATCH] fix stepper test-engine unclosed input-port (in windows) problem --- collects/tests/stepper/test-engine.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/tests/stepper/test-engine.rkt b/collects/tests/stepper/test-engine.rkt index 6a5cbc0068..748ab27a74 100644 --- a/collects/tests/stepper/test-engine.rkt +++ b/collects/tests/stepper/test-engine.rkt @@ -123,6 +123,8 @@ models)] [else (test-sequence models exp-str expected-steps extra-files error-box)])) +(define port null) + ;; test-sequence : ll-model? string? steps? extra-files? -> (void) ;; given a language model and an expression and a sequence of steps, ;; check to see whether the stepper produces the desired steps @@ -136,6 +138,7 @@ (unless (display-only-errors) (printf "testing string: ~v\n" exp-str)) (test-sequence/core render-settings expander-thunk expected-steps error-box) + (close-input-port port) (delete-file "stepper-test") (for ([f (in-list extra-files)]) (delete-file (first f)))]))) @@ -150,7 +153,8 @@ [(struct ll-model (namespace-spec render-settings enable-testing?)) (let ([filename "stepper-test"]) (display-to-file exp-str filename #:exists 'truncate) - (let* ([port (open-input-file filename)] + (set! port (open-input-file "stepper-test")) + (let* (#;[port (open-input-file filename)] [module-id (gensym "stepper-module-name-")]) ;; thunk this so that syntax errors happen within the error handlers: (lambda () (expand-teaching-program port read-syntax namespace-spec '() #f module-id enable-testing?))))])))