Changeset 35108 in project


Ignore:
Timestamp:
02/08/18 11:48:47 (10 days ago)
Author:
juergen
Message:

simple-tests 2.6 with ppp

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

Legend:

Unmodified
Added
Removed
  • release/4/simple-tests/tags/2.6/simple-tests.scm

    r35103 r35108  
    33; ju (at) jugilo (dot) de
    44;
    5 ; Last update: Feb 06, 2018
     5; Last update: Feb 08, 2018
    66;
    77; Copyright (c) 2011-2018, Juergen Lorenz
     
    4444
    4545(module simple-tests
    46 (export simple-tests
     46(simple-tests
    4747        define-test check simple-test
    4848        (compound-test group-on-cdrs)
    49         xpr:val and?  pe
     49        xpr:val ppp and?  pe
    5050        *locations* *failures*)
    5151(import scheme
     
    6464                  (compound-test (name) test . tests)
    6565                  (xpr:val xpr . xprs)
     66                  (ppp xpr . xprs)
    6667                  (and? . xprs)
    6768                  (pe macro-code)))
     
    8586     (cond-expand
    8687       ((not compiling)
    87         (begin (print "XXXXX " 'xpr " XXXXX")
     88        (begin (print "=== " 'xpr " ===")
    8889               (pp xpr)
    8990               (newline))
     
    9293       (else)))))
    9394
     95;;; (ppp xpr ...)
     96;;; -------------
     97;;; pretty-print with headline
     98(define-syntax ppp
     99  (syntax-rules ()
     100    ((_ xpr ...)
     101     (xpr:val xpr ...))))
     102
    94103;;; (and? . xprs)
    95104;;; -------------
    96105;;; non-short-circuited and which executes all side-effects
    97 (define-syntax and?
    98   (syntax-rules ()
    99     ((_ . xprs)
    100      (let ((result #t))
    101        (for-each (lambda (x) (if (not x) (set! result #f)))
    102                  (list . xprs))
    103        result))))
     106(define (and? . xprs)
     107  (let ((result #t))
     108    (for-each (lambda (x) (if (not x) (set! result #f)))
     109              xprs)
     110    result))
    104111
    105112;; helper macro because I don't want to export it
  • release/4/simple-tests/tags/2.6/simple-tests.setup

    r35103 r35108  
    77 'simple-tests
    88 '("simple-tests.so" "simple-tests.import.so")
    9  '((version "2.5.1")))
     9 '((version "2.6")))
  • release/4/simple-tests/tags/2.6/tests/run.scm

    r30445 r35108  
    3434      (+?)
    3535      (*?)))
     36  (define-test (baz)
     37    (check
     38      (and? #t #t #t)
     39      (and?)
     40      (not (and? #t #f #t))))
     41
    3642
    3743(compound-test (simple-tests)
     44  (baz)
    3845  (arithmetic?)
    3946  (foo 1 2)
  • release/4/simple-tests/trunk/simple-tests.scm

    r35103 r35108  
    33; ju (at) jugilo (dot) de
    44;
    5 ; Last update: Feb 06, 2018
     5; Last update: Feb 08, 2018
    66;
    77; Copyright (c) 2011-2018, Juergen Lorenz
     
    4444
    4545(module simple-tests
    46 (export simple-tests
     46(simple-tests
    4747        define-test check simple-test
    4848        (compound-test group-on-cdrs)
    49         xpr:val and?  pe
     49        xpr:val ppp and?  pe
    5050        *locations* *failures*)
    5151(import scheme
     
    6464                  (compound-test (name) test . tests)
    6565                  (xpr:val xpr . xprs)
     66                  (ppp xpr . xprs)
    6667                  (and? . xprs)
    6768                  (pe macro-code)))
     
    8586     (cond-expand
    8687       ((not compiling)
    87         (begin (print "XXXXX " 'xpr " XXXXX")
     88        (begin (print "=== " 'xpr " ===")
    8889               (pp xpr)
    8990               (newline))
     
    9293       (else)))))
    9394
     95;;; (ppp xpr ...)
     96;;; -------------
     97;;; pretty-print with headline
     98(define-syntax ppp
     99  (syntax-rules ()
     100    ((_ xpr ...)
     101     (xpr:val xpr ...))))
     102
    94103;;; (and? . xprs)
    95104;;; -------------
    96105;;; non-short-circuited and which executes all side-effects
    97 (define-syntax and?
    98   (syntax-rules ()
    99     ((_ . xprs)
    100      (let ((result #t))
    101        (for-each (lambda (x) (if (not x) (set! result #f)))
    102                  (list . xprs))
    103        result))))
     106(define (and? . xprs)
     107  (let ((result #t))
     108    (for-each (lambda (x) (if (not x) (set! result #f)))
     109              xprs)
     110    result))
    104111
    105112;; helper macro because I don't want to export it
  • release/4/simple-tests/trunk/simple-tests.setup

    r35103 r35108  
    77 'simple-tests
    88 '("simple-tests.so" "simple-tests.import.so")
    9  '((version "2.5.1")))
     9 '((version "2.6")))
  • release/4/simple-tests/trunk/tests/run.scm

    r30445 r35108  
    3434      (+?)
    3535      (*?)))
     36  (define-test (baz)
     37    (check
     38      (and? #t #t #t)
     39      (and?)
     40      (not (and? #t #f #t))))
     41
    3642
    3743(compound-test (simple-tests)
     44  (baz)
    3845  (arithmetic?)
    3946  (foo 1 2)
Note: See TracChangeset for help on using the changeset viewer.