From 91ef073c09b395a745f41d499226f679b8c7254f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 19 Nov 2011 07:55:34 -0700 Subject: [PATCH] expand phase-related require/provide test to check for the bug fixed by 76c9996ac75c and other potential problems --- collects/tests/racket/macro.rktl | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/collects/tests/racket/macro.rktl b/collects/tests/racket/macro.rktl index 23306290bb..66699f0199 100644 --- a/collects/tests/racket/macro.rktl +++ b/collects/tests/racket/macro.rktl @@ -638,19 +638,32 @@ (test (syntax->datum (eval (read i))) values '(#s(foo bar))))) ;; ---------------------------------------- -;; Check provide of marked names in various phases: +;; Check require & provide of marked names in various phases: (module phase-providing-check racket/base - (define-syntax-rule (bounce phase) + (define-syntax-rule (bounce phase phase+1) (begin (#%require (for-meta phase racket/base)) - (#%provide (for-meta phase printf)))) + (#%provide (for-meta phase printf) + (for-meta phase+1 syntax-rules)) + (define (expect f v) + (unless (f v) + (error 'marks "failure at phase ~s: ~s vs. ~s" + phase f v))) + (expect list? (identifier-binding #'printf phase)) + (expect list? (identifier-binding #'syntax-rules phase+1)) + (unless (or (eq? phase phase+1) + (eq? phase+1 0)) + (expect not (identifier-binding #'printf phase+1))))) - (bounce 0) - (bounce 1) - (bounce 2) - (bounce #f) + (bounce 0 1) + (bounce 1 2) + (bounce 2 3) + (bounce -2 -1) + (bounce -1 0) + (bounce #f #f) (define printf 'ok!)) +(require 'phase-providing-check) ;; ----------------------------------------