;;;; srfi-195-test.scm -*- Scheme -*- (import test) (test-begin "SRFI 195") ;;; (import (srfi 195)) (import (chicken base)) ;; (test-assert (not (box? 3))) (let ((tbox (box 1 'a 8.5))) (test-assert (box? tbox)) (test 3 (box-arity tbox)) (test 1 (unbox tbox)) (test '(1 a 8.5) (let-values (((x y z) (unbox tbox))) (list x y z))) (test-error (unbox-value tbox -2)) (test-error (unbox-value tbox 5)) (test 1 (unbox-value tbox 0)) (test 'a (unbox-value tbox 1)) (test 8.5 (unbox-value tbox 2)) (set-box! tbox #t) (test 1 (box-arity tbox)) (test-assert (unbox tbox)) (set-box-value! tbox 0 'a) (test 'a (unbox tbox)) (test 'a (unbox-value tbox 0)) (test-error (unbox-value tbox 1)) ) ;;; (test-end "SRFI 195") (test-exit)