Add new test for force/delay.

Fix tests that have errors to have appropriate parameters.

original commit: 717a81283582694de7508f6251e2d880da78d8cc
This commit is contained in:
Sam Tobin-Hochstadt 2008-07-07 17:15:10 -04:00
parent 6cd98e19ef
commit dbca8c34e4
3 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,9 @@
#lang typed-scheme
(require scheme/promise)
;((plambda: (a) ([x : a]) x) (error 'foo))
(force (delay 3))
(call-with-values (lambda () 3) list)

View File

@ -2,4 +2,6 @@
(require string-constants/string-constant)
(string-constant cancel)
(string-constant cancel)
(this-language)

View File

@ -35,7 +35,8 @@
(syntax-case stx ()
[(_ e)
#`(parameterize ([delay-errors? #f]
[current-namespace (namespace-anchor->namespace anch)])
[current-namespace (namespace-anchor->namespace anch)]
[orig-module-stx (quote-syntax e)])
(let ([ex (expand 'e)])
(find-mutated-vars ex)
(tc-expr ex)))]))
@ -648,7 +649,8 @@
))
(test-suite
"check-type tests"
(test-exn "Fails correctly" exn:fail:syntax? (lambda () (check-type #'here N B)))
(test-exn "Fails correctly" exn:fail:syntax? (lambda () (parameterize ([orig-module-stx #'here])
(check-type #'here N B))))
(test-not-exn "Doesn't fail on subtypes" (lambda () (check-type #'here N Univ)))
(test-not-exn "Doesn't fail on equal types" (lambda () (check-type #'here N N)))
)