test/checks.ss
#lang scheme

(require scheme/pretty "../require-provide.ss")

(require/provide (planet schematics/schemeunit:2:11/test)
                 (planet schematics/schemeunit:2:11/graphical-ui))

(provide (all-defined-out))

(define-syntax test
  (syntax-rules ()
    [(_ term) (test-case (pretty-format 'term) term)]
    [(_ term ...) (test-case (pretty-format '(begin term ...)) term ...)]))

(define-syntax-rule (test-ok body ...)
  (test (check-ok body ...)))

(define-syntax-rule (test-bad body ...)
  (test (check-bad body ...)))

(define-syntax-rule (with/c c e)
  (let () (with-contract value ([value c]) (define value e)) value))

(define-syntax-rule (check-ok body ...)
  (check-not-exn (lambda () body ...)))

(define-syntax-rule (check-bad body ...)
  (check-exn exn:fail:contract? (lambda () body ...)))