fix tests

This commit is contained in:
AlexKnauth 2015-04-16 17:41:52 -04:00
parent 130216c2b8
commit 5e7c99f10a

View File

@ -79,11 +79,11 @@
(module+ test
(check-equal? (afl-read (open-input-string "#λ(+ % %2)"))
'(lambda (%1 %2)
(define-syntax % (make-rename-transformer #'%1))
(define-syntax % (#%app make-rename-transformer #'%1))
(+ % %2)))
(check-equal? (afl-read (open-input-string "#λ(+ _ _2)") #:arg-str "_")
'(lambda (_1 _2)
(define-syntax _ (make-rename-transformer #'_1))
(define-syntax _ (#%app make-rename-transformer #'_1))
(+ _ _2)))
)
@ -132,24 +132,24 @@
(define chk (compose1 syntax->datum parse))
(check-equal? (chk #'(+))
'(lambda ()
(define-syntax % (make-rename-transformer #'%1))
(define-syntax % (#%app make-rename-transformer #'%1))
(+)))
(check-equal? (chk #'(+ 2 %1 %1))
'(lambda (%1)
(define-syntax % (make-rename-transformer #'%1))
(define-syntax % (#%app make-rename-transformer #'%1))
(+ 2 %1 %1)))
(check-equal? (chk #'(+ 2 %3 %2 %1))
'(lambda (%1 %2 %3)
(define-syntax % (make-rename-transformer #'%1))
(define-syntax % (#%app make-rename-transformer #'%1))
(+ 2 %3 %2 %1)))
(check-equal? (chk #'(apply list* % %&))
'(lambda (%1 . %&)
(define-syntax % (make-rename-transformer #'%1))
(define-syntax % (#%app make-rename-transformer #'%1))
(apply list* % %&)))
(check-equal? (parameterize ([current-arg-string "_"])
(chk #'(apply list* _ _&)))
'(lambda (_1 . _&)
(define-syntax _ (make-rename-transformer #'_1))
(define-syntax _ (#%app make-rename-transformer #'_1))
(apply list* _ _&))))
;; parse-args : Stx -> KW-Formals-Stx