test-adt-init-error.rkt (667B)
1 #lang typed/racket 2 3 (require phc-adt 4 syntax/macro-testing 5 typed/rackunit 6 type-expander) 7 8 (define compile-time-exception-regexp 9 #px"phc-adt: adt-init must be called before using the features in phc-adt") 10 (check-exn compile-time-exception-regexp 11 (λ () (convert-compile-time-error 12 (tagged tg [x "x"] [y 2])))) 13 (check-exn compile-time-exception-regexp 14 (λ () (convert-compile-time-error 15 (match '() [(tagged tg x y) 'a] [_ 'b])))) 16 (check-exn compile-time-exception-regexp 17 (λ () (convert-compile-time-error 18 (let () (define-type foo (tagged tg x y)) 1))))