fix check-error so it compares the rewritten error messages,

not the raw error messages
This commit is contained in:
Robby Findler 2012-08-29 20:32:25 -05:00
parent a85438bc69
commit 6ca79d56fa
2 changed files with 9 additions and 2 deletions

View File

@ -201,9 +201,11 @@
(send (send test-engine get-info) add-check)
(let ([result (with-handlers ([exn?
(lambda (e)
(or (equal? (exn-message e) error)
(define msg
(rewrite-contract-error-message (exn-message e)))
(or (equal? msg error)
(make-incorrect-error src (test-format) error
(exn-message e) e)))])
msg e)))])
(let ([test-val (test)])
(make-expected-error src (test-format) error test-val)))])
(if (check-fail? result)

View File

@ -28,6 +28,11 @@
#:repl-check-failures-expected
(list (make-check-expect-failure "1" "2" 3 2)))
(unless dmda?
(test-expression (format "~s" '(check-error (first 212) "first: expects a non-empty list; given: 212"))
"The test passed!"
#:repl-expected "Both tests passed!"))
(unless dmda?
(test-expression "(check-expect (car 0) 2)"
"car: expects a pair, given 0"