add regression test for (Sequenceof T)

Test to make sure `(Sequenceof (Boxof T))` wraps sequence elements in a contract
This commit is contained in:
Ben Greenman 2017-11-08 21:04:27 -05:00
parent f35a6fd5cb
commit 9fe2252eef

View File

@ -13,7 +13,15 @@
(require (submod ".." typed))
(define (bar) (foo 0)))
(module contract-test typed/racket/base
(define b* : (Sequenceof (Boxof Integer)) (list (box 0)))
(provide b*))
(require 'typed
'other-typed)
(foo 0)
(bar)
'other-typed
'contract-test
rackunit)
(check-equal? (foo 0) "I got an integer: 0")
(check-equal? (bar) "I got an integer: 0")
(check-exn exn:fail:contract?
(λ () (set-box! (car b*) 'NaN)))