test that

v6.3-exception
Matthew Butterick 7 years ago
parent c8bac11d8b
commit 73fb09a017

@ -37,6 +37,17 @@
(map (λ (ids) (remove-duplicates ids bound-identifier=?)) (list bound-literals unbound-literals))) (map (λ (ids) (remove-duplicates ids bound-identifier=?)) (list bound-literals unbound-literals)))
(module+ test
(define b-id 42)
(match-let ([(list bs ubs) (generate-bound-and-unbound-literals #'(ub-id b-id FOO))])
(check-equal? (map syntax->datum bs) '(b-id))
(check-equal? (map syntax->datum ubs) '(ub-id)))
(match-let ([(list bs ubs) (generate-bound-and-unbound-literals #'(ub-id b-id FOO) #:treat-as-bound #'ub-id)])
(check-equal? (map syntax->datum bs) '(b-id))
(check-equal? (map syntax->datum ubs) '()))
(check-exn exn:fail:contract? (λ () (generate-bound-and-unbound-literals #'(ub-id b-id FOO) #:treat-as-bound 42))))
(define (ellipses-follow-wildcards-or-subpatterns? pat) (define (ellipses-follow-wildcards-or-subpatterns? pat)
(let loop ([datum (syntax->datum pat)]) (let loop ([datum (syntax->datum pat)])
(match datum (match datum

Loading…
Cancel
Save