Changeset 38690 in project


Ignore:
Timestamp:
05/12/20 20:28:42 (3 weeks ago)
Author:
juergen
Message:

simple-tests 2.2 docu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/simple-tests

    r38641 r38690  
    4343pretty-prints expanded macro-code.
    4444
     45==== ppp
     46
     47<macro>(ppp xpr ...)</macro>
     48
     49print each xpr quoted in a headline and pretty-print its computed value.
     50
     51==== ppp*
     52
     53<macro>(ppp* xpr ypr . xpr-yprs)</macro>
     54
     55print each xpr quoted in a headline, and pretty-print xpr's computed as well as
     56its expected value, ypr.
     57
     58==== ppp**
     59
     60<macro>(ppp** ((var val) ...) xpr ypr . xpr-yprs)
     61
     62wrap ppp* into a let.
     63
    4564==== xpr:val
    4665
    4766<macro>(xpr:val xpr ...)</macro>
    4867
    49 print each xpr quoted in a headline and pretty-print its computed value.
    50 
    51 ==== ppp
    52 
    53 <macro>(ppp xpr ...)</macro>
    54 
    5568print each xpr quoted in a headline and pretty-print its computed value,
    56 alias to xpr:val
    57 
    58 ==== ppp*
    59 
    60 <macro>(ppp* :xpr val: ...)</macro>
    61 
    62 print each xpr quoted in a headline, and pretty-print xpr's computed as well as
    63 its expected value.
     69alias to ppp.
    6470
    6571==== xpr:val*
    6672
    67 <macro>(xpr:val* :xpr val: ...)</macro>
     73<macro>(xpr:val* xpr ypr . xpr-yprs)</macro>
    6874
    6975alias to ppp*
    70 
    71 === Old interface
    72 
    73 ==== compound-test
    74 
    75 <macro>(compound-test (name) test ...)</macro>
    76 
    77 This is the obligatory wrapper around each individual test predicate.
    78 Runs each test (usually created by define-test) in sequence and
    79 prints the results of each as well as a combined result.
    80 Exits with 0 or 1 depending on success or failure.
    81 
    82 ==== define-test
    83 
    84 <macro>(define-test (name . parameters) form . forms)</macro>
    85 
    86 creates a test predicate, (name . parameters), to be called within
    87 compound-test. That predicate will test and report the results of all of
    88 its form arguments.
    89 
    90 ==== *locations*
    91 
    92 global dynamic variable controlling location of possibly nested tests.
    93 
    94 ==== *failures*
    95 
    96 global variable collecting failure information
    97 
    98 === New interface
    9976
    10077==== ==
     
    11188operator, (== x) will do it for you.
    11289
    113 ==== do-checks
    114 
    115 <macro>(do-checks (name? verbose? :arg val: ...) :xpr expected: ...)</macro>
     90=== Old interface
     91
     92==== compound-test
     93
     94<macro>(compound-test (name) test ...)</macro>
     95
     96This is the obligatory wrapper around each individual test predicate.
     97Runs each test (usually created by define-test) in sequence and
     98prints the results of each as well as a combined result.
     99Exits with 0 or 1 depending on success or failure.
     100
     101==== define-test
     102
     103<macro>(define-test (name . parameters) form . forms)</macro>
     104
     105creates a test predicate, (name . parameters), to be called within
     106compound-test. That predicate will test and report the results of all of
     107its form arguments.
     108
     109==== *locations*
     110
     111global dynamic variable controlling location of possibly nested tests.
     112
     113==== *failures*
     114
     115global variable collecting failure information
     116
     117=== New interface
     118
     119==== define-checks
     120
     121<macro>(define-checks (name? verbose? var val . var-vals) xpr ypr .  xpr-yprs)</macro>
    116122
    117123defines a unary predicate, name?, with argument verbose?, which compares
    118 all pairs :xpr expected: and prints a list of failures, if verbose? is
     124all pairs xpr ypr and prints a list of failures, if verbose? is
    119125#t or not given.  Otherwise simply returns #t or #f, depending on the
    120126comparison of the pairs' items.
     
    124130
    125131Comparison is done by the generic procedure ==.
    126 Each :arg val: pair is translated into a let,  supplying values to be used in test pairs.
    127 
    128 ==== define-checks
    129 
    130 <macro>(define-checks (name? verbose? :arg val: ...) :xpr expected: ...)</macro>
    131 
    132 alias to do-checks
     132Each var val pair is translated into a let,  supplying values to be used in test pairs.
     133
     134==== do-checks
     135
     136<macro>(do-checks (name? verbose? var val . var-vals) xpr ypr .  xpr-yprs)</macro>
     137
     138alias to define-checks
    133139
    134140==== check-all
     
    179185== Last update
    180186
    181 Apr 24, 2020
     187Mai 12, 2020
    182188
    183189== Author
     
    218224== Version History
    219225
     226; 2.2 : ppp** added
    220227; 2.1 : do-checks as an alias to define-checks added
    221228; 2.0.3 : bugfix: protect state changing functions
Note: See TracChangeset for help on using the changeset viewer.