gui/gui-lib/embedded-gui/private/tests/test-macro.rkt
2014-12-02 02:33:07 -05:00

19 lines
498 B
Racket

(module test-macro mzscheme
(require mzlib/etc)
(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))))))
)