Changeset 38640 in project for release


Ignore:
Timestamp:
04/24/20 11:57:20 (3 months ago)
Author:
juergen
Message:

simple-tests 2.1 with do-checks added

Location:
release/5/simple-tests
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • release/5/simple-tests/tags/2.1/simple-tests.egg

    r38612 r38640  
    44 (category testing)
    55 (license "BSD")
    6  (version "2.0.3")
     6 (version "2.1")
    77 (author "Juergen Lorenz")
    88 (components (extension simple-tests
  • release/5/simple-tests/tags/2.1/simple-tests.scm

    r38612 r38640  
    6060  ==
    6161  define-checks
     62  do-checks
    6263  (check-all check-all-proc)
    6364  )
     
    9091                  (== x)
    9192                  (== type? type-equal?)
    92                   (define-checks (name? verbose? {arg val} ...) {xpr expected} ....)
     93                  (do-checks (name? verbose? :arg val: ...) :xpr expected: ....)
     94                  (define-checks (name? verbose? :arg val: ...) :xpr expected: ....)
    9395                  (check-all name check-xpr ....)))
    9496    )
     
    357359      )))
    358360
    359 ;;; (define-checks (name? verbose? {arg val} ...) {xpr expect} ....)
     361;;; (do-checks (name? verbose? :arg val: ...) :xpr expect: ....)
    360362;;; ----------------------------------------------------------------
    361363;;; returns a unary predicate, name?, comparing xpr with expect ....
    362364;;; and using arg val ... within this checks
    363 (define-syntax define-checks
     365(define-syntax do-checks
    364366  (er-macro-transformer
    365367    (lambda (form rename compare?)
     
    445447 ))))
    446448
     449;;; (define-checks (name? verbose? :arg val: ...) :xpr expect: ....)
     450;;; ----------------------------------------------------------------
     451;;; returns a unary predicate, name?, comparing xpr with expect ....
     452;;; and using arg val ... within this checks
     453;;; Alias to do-checks
     454(define-syntax define-checks
     455  (syntax-rules ()
     456    ((_(name? verbose? . arg-val-pairs) xpr expect . xpr-expect-pairs)
     457     (do-checks (name? verbose? . arg-val-pairs)
     458                xpr expect .  xpr-expect-pairs))))
     459
    447460(define (check-all-proc name . test-name-pairs) ; internal to check-all
    448461  ; used internally in check-all, must be exported within check-all
  • release/5/simple-tests/tags/2.1/tests/run.scm

    r38612 r38640  
    3939
    4040;;; new interface
     41;;; define-checks is an alias to do-checks
    4142
    42 (define-checks (bar? verbose? n 5)
     43(do-checks (bar? verbose? n 5)
    4344  (positive? n) #t
    4445  (even? n) #f)
     
    5657  (*? #f) #t)
    5758
    58 (define-checks (baz? verbose?)
     59(do-checks (baz? verbose?)
    5960  (and? #t #t #t) #t
    6061  (and?) #t
  • release/5/simple-tests/trunk/simple-tests.egg

    r38612 r38640  
    44 (category testing)
    55 (license "BSD")
    6  (version "2.0.3")
     6 (version "2.1")
    77 (author "Juergen Lorenz")
    88 (components (extension simple-tests
  • release/5/simple-tests/trunk/simple-tests.scm

    r38612 r38640  
    6060  ==
    6161  define-checks
     62  do-checks
    6263  (check-all check-all-proc)
    6364  )
     
    9091                  (== x)
    9192                  (== type? type-equal?)
    92                   (define-checks (name? verbose? {arg val} ...) {xpr expected} ....)
     93                  (do-checks (name? verbose? :arg val: ...) :xpr expected: ....)
     94                  (define-checks (name? verbose? :arg val: ...) :xpr expected: ....)
    9395                  (check-all name check-xpr ....)))
    9496    )
     
    357359      )))
    358360
    359 ;;; (define-checks (name? verbose? {arg val} ...) {xpr expect} ....)
     361;;; (do-checks (name? verbose? :arg val: ...) :xpr expect: ....)
    360362;;; ----------------------------------------------------------------
    361363;;; returns a unary predicate, name?, comparing xpr with expect ....
    362364;;; and using arg val ... within this checks
    363 (define-syntax define-checks
     365(define-syntax do-checks
    364366  (er-macro-transformer
    365367    (lambda (form rename compare?)
     
    445447 ))))
    446448
     449;;; (define-checks (name? verbose? :arg val: ...) :xpr expect: ....)
     450;;; ----------------------------------------------------------------
     451;;; returns a unary predicate, name?, comparing xpr with expect ....
     452;;; and using arg val ... within this checks
     453;;; Alias to do-checks
     454(define-syntax define-checks
     455  (syntax-rules ()
     456    ((_(name? verbose? . arg-val-pairs) xpr expect . xpr-expect-pairs)
     457     (do-checks (name? verbose? . arg-val-pairs)
     458                xpr expect .  xpr-expect-pairs))))
     459
    447460(define (check-all-proc name . test-name-pairs) ; internal to check-all
    448461  ; used internally in check-all, must be exported within check-all
  • release/5/simple-tests/trunk/tests/run.scm

    r38612 r38640  
    3939
    4040;;; new interface
     41;;; define-checks is an alias to do-checks
    4142
    42 (define-checks (bar? verbose? n 5)
     43(do-checks (bar? verbose? n 5)
    4344  (positive? n) #t
    4445  (even? n) #f)
     
    5657  (*? #f) #t)
    5758
    58 (define-checks (baz? verbose?)
     59(do-checks (baz? verbose?)
    5960  (and? #t #t #t) #t
    6061  (and?) #t
Note: See TracChangeset for help on using the changeset viewer.