From b18a733a2b0e3f28773529b6074df9d87dc45a52 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 2 Feb 1999 20:12:42 +0000 Subject: [PATCH] . original commit: 9537414b3b51edbd7cc40823565560ef05d6910c --- collects/tests/mzscheme/unit.ss | 58 +++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/collects/tests/mzscheme/unit.ss b/collects/tests/mzscheme/unit.ss index ab06ed3..7b3dc49 100644 --- a/collects/tests/mzscheme/unit.ss +++ b/collects/tests/mzscheme/unit.ss @@ -450,10 +450,64 @@ (invoke-unit (unit (import) - (export) + (export define-values) (define define-values 10) define-values)))) +; Escpecially for zodiac: +(test '(b c 10 b a (c a b) (c b a) (c . c) (a) #t + (nested-b a b c)) + 'invoke-w/shadowed-alot + (let ([a 'bad-a] + [b 'bad-b] + [c 'bad-c] + [struct:d 'bad-d] + [i 'bad-i]) + (invoke-unit + (unit + (import) + (export b) + (define a 'a) + (define b 'tmp-b) + (begin + (define c 'c) + (define-struct d (w))) + (define x '...) + + (define-struct (e struct:d) ()) + (set! b 'b) + (set! x (cons c c)) + + (define i (interface ())) + + (list + (if (eq? a 'a) + b + c) + (if (eq? a 'bad-a) + b + c) + (d-w (make-e 10)) + (begin a b) + (begin0 a b) + (let ([ab (list a b)]) + (cons c ab)) + (letrec ([mk-ba (lambda () + (list b a))]) + (cons c (mk-ba))) + x + (with-continuation-mark + b a + (current-continuation-marks b)) + (interface? (interface (i))) + (invoke-unit + (unit + (import w a) + (export) + (define b 'nested-b) + (list b w a c)) + a b)))))) + ; Not ok if defining an imported name, but error should be about ; redefining an imported name. (This behavior is not actually tested.) (syntax-test '(unit @@ -466,7 +520,7 @@ (export) (let () (define define-values 10) define-values))) -;; Invoke-unit linking in let-baound variables +;; Invoke-unit linking in let-bound variables (test '(the-x 10) 'invoke (let ([x 'the-x]) (invoke-unit