From b38a3e2378eef099466bd390795527162f9fafe7 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 22 May 2017 17:35:54 -1000 Subject: [PATCH] testier --- pitfall/pitfall/pdftest.rkt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pitfall/pitfall/pdftest.rkt b/pitfall/pitfall/pdftest.rkt index 54c4974e..5ec9ad75 100644 --- a/pitfall/pitfall/pdftest.rkt +++ b/pitfall/pitfall/pdftest.rkt @@ -17,12 +17,13 @@ (define-syntax-rule (check-copy-equal? this) - (check-equal? (file->bytes this) (file->bytes (this->control this)))) + (check-true (for/and ([b1 (in-input-port-bytes (open-input-file this))] + [b2 (in-input-port-bytes (open-input-file (this->control this)))]) + (equal? b1 b2)))) (define-syntax-rule (check-pdfkit? this) - (check-equal? (bytes-length (file->bytes this)) - (bytes-length (file->bytes (this->pdfkit-control this))))) + (check-equal? (file-size this) (file-size (this->pdfkit-control this)))) (define (make-doc ps compress? [proc (λ (doc) doc)] #:test [test? #t] #:pdfkit [pdfkit? #t]) (define doc (make-object PDFDocument (hash 'compress compress?))) @@ -32,7 +33,7 @@ (when test? (check-copy-equal? ps) (when pdfkit? - (check-pdfkit? ps)))) + (check-pdfkit? ps)))) (module reader syntax/module-reader