|
|
|
@ -128,7 +128,7 @@
|
|
|
|
|
(cons idx (car (parse-pdf-bytes (peek-bytes (- end start) start))))))
|
|
|
|
|
< #:key car))
|
|
|
|
|
|
|
|
|
|
(define (dict-compare arg1 arg2)
|
|
|
|
|
(define (dict-compare arg1 arg2 [obj-idx #f])
|
|
|
|
|
(define d1 (if (dict? arg1) arg1 (pdf->dict arg1)))
|
|
|
|
|
(define d2 (if (dict? arg2) arg2 (pdf->dict arg2)))
|
|
|
|
|
(unless (dict? d1)
|
|
|
|
@ -139,13 +139,14 @@
|
|
|
|
|
(error (format "dict lengths different in d1 (~a) and d2 (~a)" (length d1) (length d2))))
|
|
|
|
|
(for/and ([(k1 v1) (in-dict d1)]
|
|
|
|
|
[(k2 v2) (in-dict d2)])
|
|
|
|
|
(unless (equal? k1 k2)
|
|
|
|
|
(error (format "keys unequal in ~e and ~e: ~a ≠ ~a" arg1 arg2 k1 k2)))
|
|
|
|
|
(unless (equal? v1 v2)
|
|
|
|
|
(error (format "values unequal in ~e and ~e: ~e ≠ ~e" arg1 arg2 v1 v2)))
|
|
|
|
|
(when (dict? v1)
|
|
|
|
|
(dict-compare v1 v2))
|
|
|
|
|
#true))
|
|
|
|
|
(define current-object-idx (or obj-idx k1))
|
|
|
|
|
(cond
|
|
|
|
|
[(dict? v1) (dict-compare v1 v2 current-object-idx)]
|
|
|
|
|
[(not (equal? k1 k2))
|
|
|
|
|
(error (format "keys unequal in object ~a: ~a ≠ ~a" current-object-idx k1 k2))]
|
|
|
|
|
[(not (equal? v1 v2))
|
|
|
|
|
(error (format "values unequal in object ~a for key ~e: ~e ≠ ~e" current-object-idx k1 v1 v2))]
|
|
|
|
|
[else #true])))
|
|
|
|
|
|
|
|
|
|
(define-simple-check (check-headers-equal? ps1 ps2)
|
|
|
|
|
(equal? (peek-bytes 14 0 (open-input-file ps1))
|
|
|
|
|