teachpacks/testing.scm
;; DV 3/23/2007: Made this export a unit to conform to new teachpack protocol.
;; Also included the three form names to src/language/event-form.scm.
(module testing mzscheme
  (require (lib "unit.ss")
           (prefix htdp: (lib "testing.ss" "htdp")))
  
  ;; NOTE: Only minimal effort put into making these "ACL2-compatible" so far.
  #;
  (provide 
   check-expect ;; syntax : (check-expect <expression> <expression>)
   check-within ;; syntax : (check-within <expression> <expression> <expression>)
   check-error  ;; syntax : (check-error <expression> <expression>)
   (rename acl2-report generate-report) ;; -> true
   )
  
  (provide teachpack^ teachpack@)
  
  (define-signature teachpack^ 
    [generate-report
     (define-syntaxes (check-expect check-within check-error)
       (values (lambda (stx) (syntax-case stx () 
                               [(_ x ...) 
                                #`(let ()
                                    #,(syntax/loc stx (htdp:check-expect x ...))
                                    'check-expect-finished)]))
               (lambda (stx) (syntax-case stx ()
                               [(_ x ...)
                                #`(let ()
                                    #,(syntax/loc stx (htdp:check-within x ...))
                                    'check-within-finished)]))
               (lambda (stx) (syntax-case stx ()
                               [(_ x ...) 
                                #`(let ()
                                    #,(syntax/loc stx (htdp:check-error x ...))
                                    'check-error-finished)]))))])
  
  (define-unit teachpack@
    (import)
    (export teachpack^)
    (define (generate-report) (htdp:generate-report) 't))
  )