From d3ebf21d97b09ef086f61cc6bfdd7bbc124b4ccc Mon Sep 17 00:00:00 2001 From: Stevie Strickland Date: Sun, 3 Jul 2011 00:46:25 -0400 Subject: [PATCH] Fix the unit contract tests due to changes in contract violation reports. --- collects/tests/units/test-unit-contracts.rktl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/collects/tests/units/test-unit-contracts.rktl b/collects/tests/units/test-unit-contracts.rktl index d11e406dfe..3411f14978 100644 --- a/collects/tests/units/test-unit-contracts.rktl +++ b/collects/tests/units/test-unit-contracts.rktl @@ -7,16 +7,20 @@ (define (match-blame re msg) (or (regexp-match? (format "blaming ~a" re) msg) - (regexp-match? (format "self-contract violation:.*from ~a" re) msg))) + (regexp-match? (format "self-contract violation:.*blaming ~a" re) msg))) (define (match-obj re msg) - (regexp-match? (string-append "contract on " re " from") msg)) + (or (regexp-match? (format "~a: contract violation" re) msg) + (regexp-match? (format "~a: self-contract violation" re) msg))) (define (get-ctc-err msg) (cond - [(regexp-match #rx"contract violation: ([^\n]*)\n" msg) + [(regexp-match #rx"contract violation, ([^\n]*)\n" msg) => (λ (x) (cadr x))] + [(regexp-match #rx"self-contract violation, ([^\n]*)\n" msg) + => + (lambda (x) (cadr x))] [else (error 'test-contract-error (format "no specific error in message: \"~a\"" msg))]))