add safe tests

pull/3/head
Matthew Butterick 10 years ago
parent bc37761543
commit fa148d6055

@ -7,7 +7,17 @@
(with-syntax ([sym (generate-temporary)]) (with-syntax ([sym (generate-temporary)])
#'(begin #'(begin
(module sym racket (module sym racket
(require rackunit sugar net/url) (require rackunit "../main.rkt" net/url)
exprs ...)
(require 'sym)))]))
(define-syntax (eval-as-untyped-safe stx)
(syntax-case stx ()
[(_ exprs ...)
(with-syntax ([sym (generate-temporary)])
#'(begin
(module sym racket
(require rackunit (submod "../main.rkt" safe) net/url)
exprs ...) exprs ...)
(require 'sym)))])) (require 'sym)))]))
@ -17,14 +27,15 @@
(with-syntax ([sym (generate-temporary)]) (with-syntax ([sym (generate-temporary)])
#'(begin #'(begin
(module sym typed/racket (module sym typed/racket
(require typed/rackunit typed/sugar typed/net/url) (require typed/rackunit "../../typed/sugar.rkt" typed/net/url)
exprs ...) exprs ...)
(require 'sym)))])) (require 'sym)))]))
(define-syntax-rule (eval-as-typed-and-untyped exprs ...) (define-syntax-rule (eval-as-typed-and-untyped exprs ...)
(begin (begin
(eval-as-typed exprs ...) (eval-as-untyped exprs ...)
(eval-as-untyped exprs ...))) (eval-as-untyped-safe exprs ...)
(eval-as-typed exprs ...)))
(eval-as-typed-and-untyped (eval-as-typed-and-untyped

Loading…
Cancel
Save