racket/collects/tests/plai/gc/other-mutators/printing.rkt
2010-10-15 13:08:38 -06:00

19 lines
466 B
Racket

#lang plai/mutator
(allocator-setup "../good-collectors/good-collector.ss" 400)
(print-only-errors #f)
(define lst (cons 1 (cons 2 (cons 3 empty))))
(test/value=? lst '(1 2 3))
(define (length lst)
(if (empty? lst)
0
(add1 (length (rest lst)))))
(test/value=? (length '(hello goodbye)) 2)
(define tail (cons 1 empty))
(define head (cons 4 (cons 3 (cons 2 tail))))
(set-rest! tail head)
(test/location=? head (rest tail))
(test/location=? head tail)