Fix for new expander.

pull/11/head
Sam Tobin-Hochstadt 10 years ago
parent db17d1860b
commit 0be362e112

@ -7,15 +7,16 @@
(define-syntax (module-test-external stx)
(syntax-case stx ()
[(_ expr ...)
(with-syntax ([mod-name (generate-temporary)])
#'(begin
(module* mod-name racket/base
(require (submod ".."))
(require rackunit)
expr ...)
(module+ test
(require (submod ".." mod-name)))))]))
(let ([mod-name (syntax-e (generate-temporary))])
(datum->syntax stx
`(begin
(module* ,mod-name racket/base
(require (submod ".."))
(require rackunit)
,@(syntax->datum #'(expr ...)))
(module+ test
(require (submod ".." ,mod-name))))
stx))]))
(define-syntax (module-test-internal stx)
(syntax-case stx ()
@ -36,4 +37,4 @@
(let ([exprs (syntax->datum #'(expr ...))])
(datum->syntax stx `(begin
(module-test-internal ,@exprs)
(module-test-external ,@exprs)) stx))]))
(module-test-external ,@exprs)) stx))]))

@ -4,27 +4,31 @@
(define-syntax (eval-as-untyped stx)
(syntax-case stx ()
[(_ exprs ...)
(with-syntax ([sym (generate-temporary)]
[sym2 (generate-temporary)])
#'(begin
(module sym racket
(require rackunit "../main.rkt" net/url)
exprs ...)
(require 'sym)
(module sym2 racket
(require rackunit (submod "../main.rkt" safe) net/url)
exprs ...)
(require 'sym2)))]))
(let ([sym (generate-temporary)]
[sym2 (generate-temporary)])
(datum->syntax
stx
`(begin
(module ,sym racket
(require rackunit "../main.rkt" net/url)
,@(syntax->datum #'(exprs ...)))
(require ',sym)
(module ,sym2 racket
(require rackunit (submod "../main.rkt" safe) net/url)
,@(syntax->datum #'(exprs ...)))
(require ',sym2))))]))
(define-syntax (eval-as-typed stx)
(syntax-case stx ()
[(_ exprs ...)
(with-syntax ([sym (generate-temporary)])
#'(begin
(module sym typed/racket
(require typed/rackunit "../../typed/sugar.rkt" typed/net/url)
exprs ...)
(require 'sym)))]))
(let ([sym (syntax-e (generate-temporary))])
(datum->syntax stx
`(begin
(module ,sym typed/racket
(require typed/rackunit "../../typed/sugar.rkt" typed/net/url)
,@(syntax->datum #'(exprs ...)))
(require ',sym))
stx))]))
(define-syntax-rule (eval-as-typed-and-untyped exprs ...)
(begin

Loading…
Cancel
Save