Going ahead and adding this test, but need to think about how to attack it.

svn: r13602
This commit is contained in:
Stevie Strickland 2009-02-15 08:31:13 +00:00
parent af1e57d33e
commit b6fdabcd73

View File

@ -765,3 +765,24 @@
(test-runtime-error exn:fail:contract? "U@ broke contract on x"
(f 3))
(invoke-unit W@))
(let ()
(define-signature foo^
((contracted
[x? (-> number? boolean?)]
[f (-> x? number?)])))
(define-unit/contract foo@
(import)
(export (foo^ [x? (-> any/c boolean?)]))
(define (x? n) (zero? n))
(define (f x) 3))
(define-values/invoke-unit/infer foo@)
(f 0)
(test-runtime-error exn:fail:contract? "top-level broke the contract on x"
(f 4))
(test-runtime-error exn:fail:contract? "foo@ broke the contract on x"
(f #t)))