From d75d82149ec1c1f33327bd8a38e804c210e3161a Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 9 Apr 2016 18:13:44 -0700 Subject: [PATCH] add a test --- br/define.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/br/define.rkt b/br/define.rkt index 3b890ef..1eaec3d 100644 --- a/br/define.rkt +++ b/br/define.rkt @@ -72,6 +72,7 @@ (br:define #'plusser #'plus) (br:define #'(times arg) #'(* arg arg)) (br:define #'timeser #'times) + (br:define #'fortytwo #'42) (check-equal? (plus 42) +) (check-equal? plusser +) (check-equal? (plusser 42) +) @@ -82,7 +83,8 @@ (with-syntax ([zam +]) #'(zam x x))) (foo 42)) 84) ;; todo: error from define not trapped by check-exn - #;(check-exn exn:fail:syntax? (λ _ (br:define (#'times stx stx2) #'*)))) + #;(check-exn exn:fail:syntax? (λ _ (br:define (#'times stx stx2) #'*))) + (check-equal? fortytwo 42)) ;; todo: support `else` case