;;; eggdoc-testeez zbigniew $Revision: 1.2 $ $Date: 2005/11/29 03:17:30 $ (use eggdoc) (define doc `((eggdoc:begin (name "testeez") (description (p "A lightweight unit test mechanism for Scheme.")) (author (url "http://www.neilvandyke.org/testeez/" "Neil W. Van Dyke")) (history (version "0.3" "Synchronize with upstream 0.3, expose test/equiv (Zbigniew)") (version "0.1.1" "test-define with low-level macros didn't show description") (version "0.1" "Initial port of upstream 0.1 (Felix)")) (usage) (download "testeez.egg") (documentation (p "See the " (url "http://www.neilvandyke.org/testeez/testeez.html" "official documentation") ". There are a couple of additions for Chicken:") (group (definition (signature "test clause" "(test/equiv DESC EXPR EXPECTED (PRED ...))") (p "Additional clause form which allows you to specify one or more custom " "equivalence predicates. You should either specify one predicate, which " "will be checked against every value expected; or N predicates, where N is " "the number of values expected. In the latter case, each predicate is " "checked only against its corresponding value.") (p "The form " (tt "(test/eq DESC EXPR EXPECTED)") " is exactly " "the same as " (tt "(test/equiv DESC EXPR EXPECTED (eq?))") ".") (p "This clause is non-public in the upstream version, but has been exposed " "since it seems useful. Its syntax is subject to change.")) (procedure "(%testeez:self-test)" (p "See example below.")))) (examples (p "The following definition is made available as " (tt "%testeez:self-test") " if the " (tt "debug") " feature is registered at runtime. " (br) " For example, run " (tt "csi -D debug -R testeez -eval \"(%testeez:self-test)\"") ".") (pre " (define (%testeez:self-test) (testeez \"Foo Station\" (test/equal \"Put two and two together\" (+ 2 2) 4) (test-define \"Bar function\" bar (lambda (x) (+ x 42))) (test/equal \"Bar scene\" (bar 69) 0) ;; will fail (test/eqv \"Full circle\" (* (bar -21) 2) 42) (test/equal \"Multiple\" (values (+ 2 2) (string #\\h #\\i) (char-upcase #\\p)) (values 4 \"hi\" #\\P)) (test/equiv \"Multiple predicates\" (values (+ 2 2) (string #\\h #\\i) (char-upcase #\\p)) (values 4 \"hi\" #\\P) (eqv? string=? char=?))))") (p "Output:") (pre " #;1> (%testeez:self-test) ;;; BEGIN \"Foo Station\" TESTS ;; 1. Put two and two together (+ 2 2) ;; ==> 4 ;; Passed. ;; DEFINE: Bar function (define bar (lambda (x) (+ x 42))) ;; 2. Bar scene (bar 69) ;; ==> 111 ;; FAILED! Expected: ;; 0 ;; 3. Full circle (* (bar -21) 2) ;; ==> 42 ;; Passed. ;; 4. Multiple (values (+ 2 2) (string #\\h #\\i) (char-upcase #\\p)) ;; ==> 4 ;; \"hi\" ;; #\\P ;; Passed. ;; 5. Multiple predicates (values (+ 2 2) (string #\\h #\\i) (char-upcase #\\p)) ;; ==> 4 ;; \"hi\" ;; #\\P ;; Passed. ;;; END \"Foo Station\" TESTS: FAILED ;;; (Total: 5 Passed: 4 Failed: 1) ")) (license "Copyright (c) 2005 Neil W. Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See for details. For other license options and consulting, contact the author.") ))) (eggdoc->html doc)