Fix a few more chicken bugs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7075 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f365398d8c
commit
3c8513346d
5 changed files with 23 additions and 7 deletions
|
|
@ -1,2 +1,3 @@
|
|||
(load-library 'contract "contract.so")
|
||||
(include "testsuite.ss")
|
||||
(include "../schemerunme/contract.scm")
|
||||
|
|
|
|||
12
SWIG/Examples/test-suite/chicken/testsuite.ss
Normal file
12
SWIG/Examples/test-suite/chicken/testsuite.ss
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(define (lookup-ext-tag tag)
|
||||
(cond
|
||||
((equal? tag '(quote swig-contract-assertion-failed))
|
||||
'( ((exn type) #f)) )
|
||||
(#t '())))
|
||||
|
||||
(define-macro (expect-throw tag-form form)
|
||||
`(if (condition-case (begin ,form #t)
|
||||
,@(lookup-ext-tag tag-form)
|
||||
((exn) (print "The form threw a different error than expected: " ',form) (exit 1))
|
||||
(var () (print "The form did not error as expected: " ',form) (exit 1)))
|
||||
(begin (print "The form returned normally when it was expected to throw an error: " ',form) (exit 1))))
|
||||
|
|
@ -11,4 +11,4 @@
|
|||
(expect-throw 'swig-contract-assertion-failed
|
||||
(test-prepost 4 -10))
|
||||
|
||||
(quit)
|
||||
(exit 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue