(import test) (import srfi-111) (test-begin "SRFI 111") (test-group "Box Mutable" (let ((tbox #f)) (test-assert (box (void))) (set! tbox (box (void))) (test-assert (box? tbox)) (test-assert (set-box! tbox #t)) (test-assert (unbox tbox)) (test-assert (not (box? 3))) ) ) (test-group "Box Immutable" (let ((tbox #f)) (test-assert (immutable-box (void))) (set! tbox (immutable-box (void))) (test-assert (box? tbox)) (test-error "set-box! fails" (set-box! tbox #t)) (test-assert (unbox tbox)) (test-assert (not (box? 3))) ) ) (test-end "SRFI 111") (test-exit)