diff --git a/collects/tests/mzscheme/unit.ss b/collects/tests/mzscheme/unit.ss index 90d3601..c586ab6 100644 --- a/collects/tests/mzscheme/unit.ss +++ b/collects/tests/mzscheme/unit.ss @@ -66,9 +66,17 @@ (error-test '(compound-unit (import) (link (A (0 (B))) (B (0))) (export)) exn:unit?) (error-test '(compound-unit (import) (link (A (0)) (B (0))) (export (A x) (B))) exn:unit?) -; Self-import: -(syntax-test '(compound-unit (import) (link (A (0 (A)))) (export))) -(syntax-test '(compound-unit (import) (link (A (0 (A x)))) (export))) +; Self-import is now allowed +; (syntax-test '(compound-unit (import) (link (A (0 (A)))) (export))) +; (syntax-test '(compound-unit (import) (link (A (0 (A x)))) (export))) +(test (list (letrec ([x x]) x) 5) + 'self-import + (invoke-unit + (compound-unit + (import) + (link [U ((unit (import a) (export b) (define x a) (define b 5) (list x a)) + (U b))]) + (export)))) (unless (defined? 'test-global-var) (define test-global-var 5) diff --git a/collects/tests/mzscheme/unitsig.ss b/collects/tests/mzscheme/unitsig.ss index d167af1..febf742 100644 --- a/collects/tests/mzscheme/unitsig.ss +++ b/collects/tests/mzscheme/unitsig.ss @@ -120,8 +120,17 @@ (syntax-test '(compound-unit/sig (import (i : a)) (link (b@ : b (b@))) (export (var ((b@ 7) 5))))) (syntax-test '(compound-unit/sig (import (i : a)) (link (b@ : b (b@))) (export (var (b@ x . a))))) -(syntax-test '(compound-unit/sig (import) (link (A : () (0 A))) (export))) ; self-import -(syntax-test '(compound-unit/sig (import) (link (A : (x) (0 A))) (export))) ; self-import +; Self-import is now allowed +; (syntax-test '(compound-unit/sig (import) (link (A : () (0 A))) (export))) ; self-import +; (syntax-test '(compound-unit/sig (import) (link (A : (x) (0 A))) (export))) ; self-import +(test (list (letrec ([x x]) x) 5) + 'self-import + (invoke-unit/sig + (compound-unit/sig + (import) + (link [U : (a) ((unit/sig (a) (import (a)) (rename (b a)) (define x a) (define b 5) (list x a)) + U)]) + (export)))) (test #t unit/sig? (unit/sig a (import))) (test #t unit/sig? (unit/sig b (import) (define x 1) (define y 2)))