racket/collects/htdp/Test/tester.ss
Matthias Felleisen fb644c1caf relevant teachpacks converted
svn: r9470
2008-04-25 00:50:03 +00:00

21 lines
388 B
Scheme

#lang scheme
(provide test-error)
(define-syntax test-error
(lambda (stx)
(syntax-case stx ()
[(_ form ...)
(syntax
(with-handlers ([exn? (lambda (e)
(printf "~a~n" (exn-message e))
#t)])
form ...
#f))])))
#| Tests:
(not (test-error 1 2 3))
(test-error (/ 1 0) 2 3)
|#