adjust testing macro

pull/17/head
Matthew Butterick 9 years ago
parent 3fab229f40
commit 5b53ea9653

@ -1,22 +1,21 @@
#lang racket #lang racket
(require (for-syntax racket/syntax)) (require (for-syntax racket/syntax syntax/strip-context))
(define-syntax (eval-as-untyped stx) (define-syntax (eval-as-untyped stx)
(syntax-case stx () (syntax-case stx ()
[(_ exprs ...) [(_ exprs ...)
(let ([sym (generate-temporary)] (with-syntax ([module-without-contracts (generate-temporary)]
[sym2 (generate-temporary)]) [module-with-contracts (generate-temporary)])
(datum->syntax (replace-context stx
stx #'(begin
`(begin (module module-without-contracts racket
(module ,sym racket (require rackunit "../main.rkt" net/url)
(require rackunit "../main.rkt" net/url) exprs ...)
,@(syntax->datum #'(exprs ...))) (require 'module-without-contracts)
(require ',sym) (module module-with-contracts racket
(module ,sym2 racket (require rackunit (submod "../main.rkt" safe) net/url)
(require rackunit (submod "../main.rkt" safe) net/url) exprs ...)
,@(syntax->datum #'(exprs ...))) (require 'module-with-contracts))))]))
(require ',sym2))))]))
(eval-as-untyped (eval-as-untyped

Loading…
Cancel
Save