cs: fix incorrect impersonator discard in chaperone-of?
This commit is contained in:
parent
b3f66a4973
commit
cc487a4d9a
|
@ -196,6 +196,15 @@
|
||||||
(test (void) vector-set! b2 1 'fine)
|
(test (void) vector-set! b2 1 'fine)
|
||||||
(test 'fine vector-ref b 1)))
|
(test 'fine vector-ref b 1)))
|
||||||
|
|
||||||
|
;; impersonator-of does not imply chaperone-of
|
||||||
|
(let ()
|
||||||
|
(define vec1 (vector 1 2 3))
|
||||||
|
(define vec2 (impersonate-vector vec1 (lambda (v i x) x) (lambda (v i x) x)))
|
||||||
|
(test #t impersonator-of? vec2 vec1)
|
||||||
|
(test #f chaperone-of? vec2 vec1)
|
||||||
|
(test #f impersonator-of? vec1 vec2)
|
||||||
|
(test #f chaperone-of? vec1 vec2))
|
||||||
|
|
||||||
;; test chaperone-of checks in a chaperone:
|
;; test chaperone-of checks in a chaperone:
|
||||||
(let ([b (vector 0)])
|
(let ([b (vector 0)])
|
||||||
(let ([b2 (chaperone-vector b
|
(let ([b2 (chaperone-vector b
|
||||||
|
|
|
@ -42,8 +42,7 @@
|
||||||
(let ([ctx (deeper-context ctx)])
|
(let ([ctx (deeper-context ctx)])
|
||||||
(equal? a2 b ctx)))]
|
(equal? a2 b ctx)))]
|
||||||
[else #f]))]
|
[else #f]))]
|
||||||
[(and (eq? mode 'chaperone-of?)
|
[(eq? mode 'chaperone-of?)
|
||||||
(chaperone? b))
|
|
||||||
;; `a` does not include `b`, so give up
|
;; `a` does not include `b`, so give up
|
||||||
#f]
|
#f]
|
||||||
[else
|
[else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user