test-subtemplate-detect-stxinfo.rkt (1992B)
1 #lang racket 2 (module m-ok racket 3 (require subtemplate/private/template-subscripts 4 stxparse-info/parse 5 stxparse-info/case 6 rackunit 7 syntax/macro-testing) 8 (check-not-exn 9 (λ () 10 (convert-compile-time-error 11 (subtemplate ok))))) 12 13 (module m-no-parse racket 14 (require subtemplate/private/template-subscripts 15 stxparse-info/case 16 rackunit 17 syntax/macro-testing) 18 (check-exn #rx"subtemplate: syntax-parse seems undefined," 19 (λ () 20 (convert-compile-time-error 21 (subtemplate ok))))) 22 23 (module m-wrong-parse racket 24 (require subtemplate/private/template-subscripts 25 syntax/parse 26 stxparse-info/case 27 rackunit 28 syntax/macro-testing) 29 (check-exn 30 #rx"subtemplate: syntax-parse resolves to the official syntax-parse," 31 (λ () 32 (convert-compile-time-error 33 (subtemplate ok))))) 34 35 (module m-wrong-case racket 36 (require subtemplate/private/template-subscripts 37 stxparse-info/parse 38 rackunit 39 syntax/macro-testing) 40 (check-exn #rx"subtemplate: syntax-case resolves to the official syntax-case," 41 (λ () 42 (convert-compile-time-error 43 (subtemplate ok))))) 44 45 (module m-no-parse-wrong-case racket 46 (require subtemplate/private/template-subscripts 47 rackunit 48 syntax/macro-testing) 49 (check-exn #rx"subtemplate: syntax-parse seems undefined," 50 (λ () 51 (convert-compile-time-error 52 (subtemplate ok))))) 53 54 (module m-wrong-parse-wrong-case racket 55 (require subtemplate/private/template-subscripts 56 syntax/parse 57 rackunit 58 syntax/macro-testing) 59 (check-exn 60 #rx"subtemplate: syntax-parse resolves to the official syntax-parse," 61 (λ () 62 (convert-compile-time-error 63 (subtemplate ok))))) 64 65 66 (require 'm-ok) 67 (require 'm-no-parse) 68 (require 'm-wrong-parse) 69 (require 'm-wrong-case) 70 (require 'm-no-parse-wrong-case) 71 (require 'm-wrong-parse-wrong-case)