~ubuntu-branches/ubuntu/hardy/swig1.3/hardy

« back to all changes in this revision

Viewing changes to Examples/test-suite/chicken/testsuite.ss

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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))))