;;;; box-test.scm -*- Scheme -*- ;;;; Kon Lovett, Jul '18 (import test) (test-begin "SRFI-111") ;;; (import (srfi 111)) (import (chicken base)) (import (only (chicken platform) features)) (test-group "Feature" (test-assert "SRFI 111" (let loop ((rem (features))) (cond ((null? rem) #f ) ((eq? #:srfi-111 (car rem)) #t ) (else (loop (cdr rem)) ) ) ) ) ) (test-group "Box" (let ((tbox (box (void)))) (test-assert (box? tbox)) (set-box! tbox #t) (test-assert (unbox tbox)) (test-assert (not (box? 3))) ) ) (test-group "Immutable Box" (let ((tbox (immutable-box #f))) (test-assert (box? tbox)) (test-assert (not (unbox tbox))) (test-error (set-box! tbox #t)) ) ) (test-end "SRFI-111") ;;; (test-end "Box") (test-exit)