Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression test for sandboxed evaluation #173

Closed
wants to merge 8 commits into from
15 changes: 10 additions & 5 deletions qi-test/tests/compiler/rules/full-cycle.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
rackunit/text-ui
syntax/macro-testing
qi/flow/core/deforest
qi/flow/core/compiler
"private/deforest-util.rkt"
(submod qi/flow/extended/expander invoke))

Expand All @@ -21,12 +22,17 @@

;; A macro that accepts surface syntax, expands it, and then applies the
;; indicated optimization passes.
(define-syntax-parser test-compile~>
(define-syntax-parser test-passes~>
[(_ stx)
#'(expand-flow stx)]
[(_ stx pass ... passN)
#'(passN
(test-compile~> stx pass ...))]))
(test-passes~> stx pass ...))])
benknoble marked this conversation as resolved.
Show resolved Hide resolved

;; A macro that expands and compiles surface syntax
(define-syntax-parse-rule (qi-compile stx)
(compile-flow
(expand-flow stx))))


(define tests
Expand All @@ -39,9 +45,8 @@
(test-true "normalize → deforest"
(deforested?
(phase1-eval
(test-compile~> #'(~>> (filter odd?) values (map sqr))
normalize-pass
deforest-pass)))))))
(qi-compile
#'(~>> (filter odd?) values (map sqr)))))))))
benknoble marked this conversation as resolved.
Show resolved Hide resolved

(module+ main
(void
Expand Down