racket/collects/embedded-gui/private/tests/test-macro.ss
2005-05-27 18:56:37 +00:00

18 lines
502 B
Scheme

(module test-macro mzscheme
(require (lib "etc.ss"))
(provide test)
;; test: (lambda (a?) ((a? a? . -> . boolean?) a? a? . -> . (void))
;; tests to see if the expression is true and prints and error if it's not
(define-syntax test
(syntax-rules (identity)
((_ test actual expected)
(let ([result
(with-handlers
([exn? identity])
actual)])
(and (not (exn? result))
(test result expected))))))
)