source: project/release/4/box/trunk/tests/run.scm @ 13468

Last change on this file since 13468 was 13468, checked in by Kon Lovett, 12 years ago

Pre-release

File size: 940 bytes
Line 
1(require-extension test)
2(import test)
3
4(require-extension box)
5(import box)
6
7(test-group "Box Mutable"
8        (let ([tbox #f])
9    (test-assert (make-box (void)))
10    (set! tbox (make-box (void)))
11    (box-set! tbox #t)
12    (test-assert (box-ref tbox))
13    (test-assert (box? tbox))
14    (test-assert (not (box? 3))) )
15)
16
17(test-group "Box Immutable"
18        (let ([tbox #f])
19    (test-assert (make-box #f #:immutable? #t))
20    (set! tbox (make-box #f #:immutable? #t))
21    (test-assert (not (box-ref tbox)))
22    (test-error (box-set! tbox #t)) )
23)
24
25(test-group "Box References"
26        (let ([var (void)]
27        [ref #f])
28    (test-assert (make-box-variable var))
29    (set! ref (make-box-variable var))
30    (test (void) (box-ref ref))
31    (box-set! ref #t)
32    (test-assert (box-ref ref))
33    (test-assert var)
34    (test-assert (box? ref))
35    (test-assert (box-variable? ref))
36    (test-assert (not (box-location? ref)))
37    (test-assert (not (box? 3))) )
38)
Note: See TracBrowser for help on using the repository browser.