Fixing GC test

This commit is contained in:
Jay McCarthy 2013-11-19 14:31:34 -07:00
parent 6d3b774be1
commit 2ae4d3aef4

View File

@ -1,16 +1,21 @@
#lang plai/gc2/mutator #lang plai/gc2/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 1024) (allocator-setup "../good-collectors/good-collector.rkt" 1024)
(test/value=? ;; xxx someday we should move this to good by fixing set! or rejecting
(let ([f 0]) ;; the program
(let ([g (lambda (n) f)])
(set! f 1)
(g 11)))
1)
(test/value=? (if (= (let ([f 0])
(let ([f (lambda (n) 'wrong-answer)]) (let ([g (lambda (n) f)])
(let ([g (lambda (n) (f n))]) (set! f 1)
(set! f (lambda (n) 'right-answer)) (g 11)))
(g 11))) 1)
'right-answer) "okay"
(/ 1 0))
(if (= (let ([f (lambda (n) 'wrong-answer)])
(let ([g (lambda (n) (f n))])
(set! f (lambda (n) 'right-answer))
(g 11)))
'right-answer)
"okay"
(/ 1 0))