Changeset 12126 in project for chicken


Ignore:
Timestamp:
10/08/08 13:02:36 (11 years ago)
Author:
felix winkelmann
Message:

must do with simpler test lib

Location:
chicken/branches/irregular/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/irregular/tests/test-irregex.scm

    r12124 r12126  
    22
    33
    4 (use test extras matchable)
     4(use test extras regex)
    55
    6 (load "regex.so")
     6(import irregex)
    77
    88(define (subst-matches matches subst)
     
    3636
    3737(define (test-re matcher line)
    38   (match (string-split line "\t" #t)
    39     ((pattern input result subst output)
     38  (apply
     39   (lambda (pattern input result subst output)
    4040     (let ((name (sprintf "~A  ~A  ~A" pattern input result)))
    4141       (cond
    42         ((equal? "c" result)
    43         (test-error name (matcher pattern input)))
    44         ((equal? "n" result)
    45         (test-assert name (not (matcher pattern input))))
    46         (else
    47          (test name output
    48            (subst-matches (matcher pattern input) subst))))))
    49     (else
    50      (warning "invalid regex test line" line))))
     42        ((equal? "c" result)
     43        (test-error name (matcher pattern input)))
     44        ((equal? "n" result)
     45        (test-assert name (not (matcher pattern input))))
     46        (else
     47         (test-equal name
     48                     (subst-matches (matcher pattern input) subst)
     49                     value)))))
     50   (string-split line "\t" #t)))
    5151
    5252
  • chicken/branches/irregular/tests/test.scm

    r10656 r12126  
    8787      (lambda () (handle-exceptions ex *fail-token* expr)) *fail-token* eq?) )
    8888    ((_ expr) (test-error 'expr expr))))
     89
     90(define-syntax test-group
     91  (syntax-rules ()
     92    ((_ name body ...)
     93     (begin body ...))))
Note: See TracChangeset for help on using the changeset viewer.