test types for typed/syntax/stx

original commit: 4c22029f0616611c826f10fc2d3320a1ab32d48b
This commit is contained in:
AlexKnauth 2014-09-08 18:50:28 -04:00 committed by Asumu Takikawa
parent c425f4f5b2
commit d650866cdb

View File

@ -15,14 +15,30 @@
(check-true (stx-list? #'(a b c d)))
(check-false (stx-list? #'a))
(syntax-e (car (stx->list #'(a b c d))))
(add1 (car (stx->list '(1 2 3))))
(ann (stx->list #'(a b c d)) (Listof (Syntaxof Symbol)))
(ann (syntax-e (car (stx->list #'(a b c d)))) Symbol)
(ann (stx->list (list #'a #'b)) (Listof (Syntaxof Symbol)))
(ann (stx->list (list 'a 'b)) (Listof Symbol))
(ann (add1 (car (stx->list '(1 2 3)))) Positive-Index)
(stx-car #'(a b))
(stx-cdr #'(a b))
(ann (stx-car #'(a b)) (Syntaxof 'a))
(ann (stx-cdr #'(a b)) (List (Syntaxof 'b)))
(stx-map (λ: ([id : Identifier]) (free-identifier=? id #'a))
#'(a b c d))
(ann (stx-map (λ: ([id : Identifier]) (free-identifier=? id #'a))
#'(a b c d))
(Listof Boolean))
(ann (stx-map (λ: ([id : Symbol]) (symbol=? id 'a))
'(a b c d))
(Listof Boolean))
(ann (stx-map (λ: ([x : (Syntaxof Real)] [y : (Syntaxof Real)])
(+ (syntax-e x) (syntax-e y)))
#'(1 2 3)
#'(1 2 3))
(Listof Real))
(ann (stx-map +
'(1 2 3)
'(1 2 3))
(Listof Real))
(module-or-top-identifier=? #'a #'b)