Ignore:
Timestamp:
04/01/20 00:27:05 (15 months ago)
Author:
Kon Lovett
Message:

update test gloss

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-19/trunk/tests/test-gloss.incl.scm

    r38361 r38433  
    22;;;test "Gloss" API
    33
    4 (define-constant *test-gloss-marker* "--> ")
     4(define-constant TEST-GLOSS-MARKER "--> ")
    55
    66(define (test-group-ref group field . o)
     
    2727      ((nm def)
    2828        (cond
    29           ((get-environment-variable nm) => string->number)
    30           (else                           def))) ) )
     29          ((get-environment-variable nm)
     30            => string->number)
     31          (else
     32            def))) ) )
    3133
    3234  ;from miscmacros
     
    6163  ;from check-errors
    6264
    63   (define (positive-integer? obj) (and (integer? obj) (positive? obj)))
     65  (define (indentation-amount? obj) (and (integer? obj) (exact? obj) (positive? obj)))
    6466
    65   (define (check-positive-integer loc obj)
    66     (unless (positive-integer? obj) (error loc "not a positive-integer" obj))
     67  (define (check-indentation-amount loc obj)
     68    (unless (indentation-amount? obj) (error loc "not a positive exact integer" obj))
    6769    obj )
    6870
     
    7476    (make-parameter
    7577      (get-environment-variable/default "TEST_INDENT_WIDTH" 4)
    76       (checked-guard test-indent-width positive-integer)))
     78      (checked-guard test-indent-width indentation-amount)))
    7779  (set! test-first-indentation
    7880    (make-parameter
    7981      (get-environment-variable/default "TEST_FIRST_INDENTATION" 1)
    80       (checked-guard test-first-indentation positive-integer)))
     82      (checked-guard test-first-indentation indentation-amount)))
    8183  (set! test-max-indentation
    8284    (make-parameter
    8385      (get-environment-variable/default "TEST_MAX_INDENTATION" 5)
    84       (checked-guard test-max-indentation positive-integer)))
     86      (checked-guard test-max-indentation indentation-amount)))
    8587  (set! test-indentation-char
    8688    (make-parameter
     
    104106      (begin
    105107        (display (test-group-indent-string (current-test-group)))
    106         (display *test-gloss-marker*)
     108        (display TEST-GLOSS-MARKER)
    107109        (for-each display (list ?obj ...))
    108110        (newline)) ) ) )
    109111
    110 ;(import (only (chicken format) format))
    111 (define (glossf fmt . args)
    112   (gloss (apply format #f fmt args)) )
     112;(import (only (chicken format) format)) ;builtin
     113;(import format)                         ;egg
     114(define-syntax glossf
     115  (syntax-rules ()
     116    ((glossf ?fmt ?arg0 ...)
     117      (gloss (format #f ?fmt ?arg0 ...)) ) ) )
Note: See TracChangeset for help on using the changeset viewer.