PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. (define (lookup-ext-tag tag)
  2. (cond
  3. ((equal? tag '(quote swig-contract-assertion-failed))
  4. '( ((exn type) #f)) )
  5. (#t '())))
  6. (define-macro (expect-throw tag-form form)
  7. `(if (condition-case (begin ,form #t)
  8. ,@(lookup-ext-tag tag-form)
  9. ((exn) (print "The form threw a different error than expected: " ',form) (exit 1))
  10. (var () (print "The form did not error as expected: " ',form) (exit 1)))
  11. (begin (print "The form returned normally when it was expected to throw an error: " ',form) (exit 1))))