Changeset 37984 in project


Ignore:
Timestamp:
11/08/19 18:27:44 (9 days ago)
Author:
juergen
Message:

simple-tests 1.1 with ppp*

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

Legend:

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

    r36308 r37984  
    44 (category testing)
    55 (license "BSD")
    6  (version "1.0")
     6 (version "1.1")
    77 (author "Juergen Lorenz")
    88 (components (extension simple-tests)))
  • release/5/simple-tests/tags/1.1/simple-tests.scm

    r36308 r37984  
    4949   xpr:val
    5050   ppp
     51   ppp*
    5152   and?
    5253   pe
     
    6566                  (check form . forms)
    6667                  (compound-test (name) test . tests)
    67                   (xpr:val xpr . xprs)
    68                   (ppp xpr . xprs)
    69                   (and? . xprs)
     68                  (xpr:val xpr ...)
     69                  (ppp xpr ...)
     70                  (ppp* {xpr val} ...)
     71                  (and? xpr ...)
    7072                  (pe macro-code)))
    7173    )
     
    8284
    8385;;; (xpr:val xpr ...)
    84 ;;; -----------------------
     86;;; -----------------
     87;;; print each xpr quoted in a headline and pretty-print xpr's computed
     88;;; value.
    8589(define-syntax xpr:val
    8690  (syntax-rules ()
     
    9599       (else)))))
    96100
     101(define-syntax help-ppp*
     102  (syntax-rules ()
     103    ((_)
     104     (print))
     105    ((_ xpr val)
     106     (begin (print "=== " 'xpr " ===")
     107            (pp xpr)
     108            (pp val)
     109            (newline)))
     110    ((_ xpr val . pairs)
     111     (begin (help-ppp* xpr val)
     112            (help-ppp* . pairs)))
     113    ))
     114
     115;;; (ppp* {xpr val} ...)
     116;;; --------------------
     117;;; print each xpr quoted in a headline and pretty-print xpr's computed
     118;;; and expected value.
     119(define-syntax ppp*
     120  (syntax-rules ()
     121    ((_ . pairs)
     122     (cond-expand
     123       ((not compiling)
     124        (help-ppp* . pairs))
     125       (else)))))
     126
     127
    97128;;; (ppp xpr ...)
    98129;;; -------------
    99 ;;; pretty-print with headline
     130;;; print each xpr quoted in a headline and pretty-print xpr's computed
     131;;; value. Alias to xpr:val.
    100132(define-syntax ppp
    101133  (syntax-rules ()
     
    247279;(import simple-tests (chicken pretty-print))
    248280;(pp (expand '(define-test (foo x) (= 5 3) (null? '()))))
     281;(ppp* (+ 3 5) 8 (* 3 5) 15 (- 2 1 1) 0)
     282;(ppp*)
  • release/5/simple-tests/trunk/simple-tests.egg

    r36308 r37984  
    44 (category testing)
    55 (license "BSD")
    6  (version "1.0")
     6 (version "1.1")
    77 (author "Juergen Lorenz")
    88 (components (extension simple-tests)))
  • release/5/simple-tests/trunk/simple-tests.scm

    r36308 r37984  
    4949   xpr:val
    5050   ppp
     51   ppp*
    5152   and?
    5253   pe
     
    6566                  (check form . forms)
    6667                  (compound-test (name) test . tests)
    67                   (xpr:val xpr . xprs)
    68                   (ppp xpr . xprs)
    69                   (and? . xprs)
     68                  (xpr:val xpr ...)
     69                  (ppp xpr ...)
     70                  (ppp* {xpr val} ...)
     71                  (and? xpr ...)
    7072                  (pe macro-code)))
    7173    )
     
    8284
    8385;;; (xpr:val xpr ...)
    84 ;;; -----------------------
     86;;; -----------------
     87;;; print each xpr quoted in a headline and pretty-print xpr's computed
     88;;; value.
    8589(define-syntax xpr:val
    8690  (syntax-rules ()
     
    9599       (else)))))
    96100
     101(define-syntax help-ppp*
     102  (syntax-rules ()
     103    ((_)
     104     (print))
     105    ((_ xpr val)
     106     (begin (print "=== " 'xpr " ===")
     107            (pp xpr)
     108            (pp val)
     109            (newline)))
     110    ((_ xpr val . pairs)
     111     (begin (help-ppp* xpr val)
     112            (help-ppp* . pairs)))
     113    ))
     114
     115;;; (ppp* {xpr val} ...)
     116;;; --------------------
     117;;; print each xpr quoted in a headline and pretty-print xpr's computed
     118;;; and expected value.
     119(define-syntax ppp*
     120  (syntax-rules ()
     121    ((_ . pairs)
     122     (cond-expand
     123       ((not compiling)
     124        (help-ppp* . pairs))
     125       (else)))))
     126
     127
    97128;;; (ppp xpr ...)
    98129;;; -------------
    99 ;;; pretty-print with headline
     130;;; print each xpr quoted in a headline and pretty-print xpr's computed
     131;;; value. Alias to xpr:val.
    100132(define-syntax ppp
    101133  (syntax-rules ()
     
    247279;(import simple-tests (chicken pretty-print))
    248280;(pp (expand '(define-test (foo x) (= 5 3) (null? '()))))
     281;(ppp* (+ 3 5) 8 (* 3 5) 15 (- 2 1 1) 0)
     282;(ppp*)
Note: See TracChangeset for help on using the changeset viewer.