original commit: 425b11cbfbd4ac718432ef17499f8de988e2291a
This commit is contained in:
Matthew Flatt 2001-01-18 04:02:58 +00:00
parent fe0f7cf428
commit 056ce17b5f

View File

@ -4,6 +4,7 @@
(import (lib "unit.ss")) (import (lib "unit.ss"))
(import (lib "unitsig.ss")) (import (lib "unitsig.ss"))
(import (lib "include.ss"))
(SECTION 'unit/sig) (SECTION 'unit/sig)
@ -132,7 +133,7 @@
(export)))) (export))))
(define-signature not-defined^ (not-defined)) (define-signature not-defined^ (not-defined))
(error-test #'(invoke-unit/sig (unit/sig () (import not-defined^) 10) not-defined^) exn:unit?) (error-test #'(invoke-unit/sig (unit/sig () (import not-defined^) 10) not-defined^) exn:variable?)
(test #t unit/sig? (unit/sig a (import))) (test #t unit/sig? (unit/sig a (import)))
(test #t unit/sig? (unit/sig b (import) (define x 1) (define y 2))) (test #t unit/sig? (unit/sig b (import) (define x 1) (define y 2)))
@ -265,7 +266,7 @@
(import) (import)
(define x 5) (define x 5)
(define-struct a (b c)) (define-struct (a (current-inspector)) (b c))
(define v (make-a 5 6)) (define v (make-a 5 6))
(define (y v) (a? v)))) (define (y v) (a? v))))
@ -465,30 +466,30 @@
; Exporting a name twice: ; Exporting a name twice:
(syntax-test (syntax-test
'(compound-unit/sig #'(compound-unit/sig
(import) (import)
(link [A : (a) ((unit/sig (a) (import) (define a 1)))]) (link [A : (a) ((unit/sig (a) (import) (define a 1)))])
(export (var (A a)) (open A)))) (export (var (A a)) (open A))))
(syntax-test (syntax-test
'(compound-unit/sig #'(compound-unit/sig
(import) (import)
(link [A : (a) ((unit/sig (a) (import) (define a 1)))] (link [A : (a) ((unit/sig (a) (import) (define a 1)))]
[B : (b) ((unit/sig (b) (import) (define b 2)))]) [B : (b) ((unit/sig (b) (import) (define b 2)))])
(export (unit A x) (unit B x)))) (export (unit A x) (unit B x))))
(syntax-test (syntax-test
'(compound-unit/sig #'(compound-unit/sig
(import) (import)
(link [A : (a) ((unit/sig (a) (import) (define a 1)))] (link [A : (a) ((unit/sig (a) (import) (define a 1)))]
[B : (b) ((unit/sig (b) (import) (define b 2)))]) [B : (b) ((unit/sig (b) (import) (define b 2)))])
(export (unit A) (unit B A)))) (export (unit A) (unit B A))))
; Can't shadow syntax/macros in unit ; Can shadow syntax/macros in unit
(syntax-test '(unit/sig () (test #t unit/sig? (unit/sig ()
(import) (import)
(define define 10))) (define define 10)))
(syntax-test '(unit/sig () (test #t unit/sig? (unit/sig ()
(import) (import)
(define lambda 11))) (define lambda 11)))
@ -515,7 +516,7 @@
; Not ok if defining an imported name, but error should be about ; Not ok if defining an imported name, but error should be about
; redefining an imported name. (This behavior is not actually tested.) ; redefining an imported name. (This behavior is not actually tested.)
(syntax-test '(unit/sig () (syntax-test #'(unit/sig ()
(import (define-values)) (import (define-values))
(define define-values 17))) (define define-values 17)))