PageRenderTime 13ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/chicken/testsuite.ss

#
Scheme | 12 lines | 11 code | 1 blank | 0 comment | 0 complexity | 279207cce84b6f4bbef742fb1a15eeae MD5 | raw file
 1(define (lookup-ext-tag tag)
 2  (cond
 3    ((equal? tag '(quote swig-contract-assertion-failed))
 4      '( ((exn type) #f)) )
 5    (#t '())))
 6
 7(define-macro (expect-throw tag-form form)
 8  `(if (condition-case (begin ,form #t)
 9         ,@(lookup-ext-tag tag-form)
10         ((exn) (print "The form threw a different error than expected: " ',form) (exit 1))
11         (var () (print "The form did not error as expected: " ',form) (exit 1)))
12   (begin (print "The form returned normally when it was expected to throw an error: " ',form) (exit 1))))