transcendental-lisp/lisp/unit-test.lisp

17 lines
390 B
Common Lisp
Raw Normal View History

(defun run-unit-test (unit-test)
(cond
((funcall unit-test) (print (cons (symbol-function unit-test) T)) T)
(T (print (cons (symbol-function unit-test) 'F)) NIL)
)
)
(defun run-test-suite (test-suite)
(cond
(test-suite (cons (run-unit-test (car test-suite)) (run-test-suite (cdr test-suite))))
)
)
(defun unit (test-suite)
(apply 'and (run-test-suite test-suite))
)