From cc0e67638cb187be7abb3ca9edb1a69e478c859c Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Wed, 8 Jan 2014 13:45:11 -0500 Subject: [PATCH] Fix contract profiler tests to test more. --- pkgs/contract-profile/utils.rkt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/contract-profile/utils.rkt b/pkgs/contract-profile/utils.rkt index 3ec0457261..89b658048e 100644 --- a/pkgs/contract-profile/utils.rkt +++ b/pkgs/contract-profile/utils.rkt @@ -1,5 +1,7 @@ #lang racket/base +(require racket/port) + (provide (all-defined-out)) (struct contract-profile @@ -25,7 +27,9 @@ (define dry-run? (make-parameter #f)) (define-syntax-rule (with-output-to-report-file file body ...) - (unless (dry-run?) - (with-output-to-file file - #:exists 'replace - (lambda () body ...)))) + (if (dry-run?) + (parameterize ([current-output-port (open-output-nowhere)]) + body ...) + (with-output-to-file file + #:exists 'replace + (lambda () body ...))))