Add new test for force/delay.
Fix tests that have errors to have appropriate parameters.
This commit is contained in:
parent
f2699abe65
commit
717a812835
9
collects/tests/typed-scheme/succeed/force-delay.ss
Normal file
9
collects/tests/typed-scheme/succeed/force-delay.ss
Normal 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)
|
|
@ -2,4 +2,6 @@
|
||||||
|
|
||||||
(require string-constants/string-constant)
|
(require string-constants/string-constant)
|
||||||
|
|
||||||
(string-constant cancel)
|
(string-constant cancel)
|
||||||
|
|
||||||
|
(this-language)
|
|
@ -35,7 +35,8 @@
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ e)
|
[(_ e)
|
||||||
#`(parameterize ([delay-errors? #f]
|
#`(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)])
|
(let ([ex (expand 'e)])
|
||||||
(find-mutated-vars ex)
|
(find-mutated-vars ex)
|
||||||
(tc-expr ex)))]))
|
(tc-expr ex)))]))
|
||||||
|
@ -648,7 +649,8 @@
|
||||||
))
|
))
|
||||||
(test-suite
|
(test-suite
|
||||||
"check-type tests"
|
"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 subtypes" (lambda () (check-type #'here N Univ)))
|
||||||
(test-not-exn "Doesn't fail on equal types" (lambda () (check-type #'here N N)))
|
(test-not-exn "Doesn't fail on equal types" (lambda () (check-type #'here N N)))
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user