Changeset 13468 in project for release/4/box/trunk/tests/run.scm


Ignore:
Timestamp:
03/03/09 18:59:42 (11 years ago)
Author:
Kon Lovett
Message:

Pre-release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/box/trunk/tests/run.scm

    r12265 r13468  
    1 ;;;; run-testbase.scm (run.scm)
     1(require-extension test)
     2(import test)
    23
    3 (use utils posix)
     4(require-extension box)
     5(import box)
    46
    5 ;;
     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)
    616
    7 #;(define *egg-name* (car (command-line-arguments)))
     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)
    824
    9 (define *verbose* #t)
    10 
    11 (define-constant TESTBASE-TEST-DRIVER "chicken-testbase-driver")
    12 (define-constant TESTBASE-TEST-DRIVER-OPTIONS "--indent 2")
    13 
    14 (define *test-driver-arguments* (string-append TESTBASE-TEST-DRIVER-OPTIONS (if *verbose* " -v" "")))
    15 
    16 ;;
    17 
    18 (system* "~A ~A ~A" TESTBASE-TEST-DRIVER *test-driver-arguments* "*-test.scm")
     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 TracChangeset for help on using the changeset viewer.