diff -ur cl-unit-1.3.1.orig/clunit.lisp cl-unit-1.3.1/clunit.lisp --- cl-unit-1.3.1.orig/clunit.lisp 2003-09-07 01:35:26.000000000 -0500 +++ cl-unit-1.3.1/clunit.lisp 2005-02-08 02:01:10.456719586 -0600 @@ -287,97 +287,3 @@ failed-tests ;with-supressed-summary )) - -(in-package "COMMON-LISP-USER") -(use-package :org.ancar.CLUnit) - -;;; -;;; Self test... -;;; - -;; tests basic test definition -(load-time-value (progn - -(deftest "test1" :category "CLUnit-pass1" - :test-fn #'(lambda () (eq (car '(a)) 'a))) - -;; tests input-fn -(deftest "test-2" :category "CLUnit-pass1" - :input-fn #'(lambda () '(a)) - :test-fn #'(lambda (x) (eq (car x) 'a))) - -;; tests output-fn -(deftest "test-3" :category "CLUnit-pass1" - :input-fn #'(lambda () '(a)) - :output-fn #'(lambda () 'a) - :test-fn #'(lambda (x) (car x))) - -;; tests remove-test, run-category, and multiple-values in test-fn and -;; output-fn -(deftest "meta" :category "CLUnit-meta" - :input-fn #'(lambda () (remove-test "test1")) - :test-fn #'(lambda (x) (declare (ignore x)) (run-category "CLUnit-pass1")) - :output-fn #'(lambda () (values t 0 2))) - -;; tests multiple values from input-fn to test-fn -(deftest "test1" :category "CLUnit-pass2" - :input-fn #'(lambda () (values 'a '(b))) - :test-fn #'cons - :output-fn #'(lambda () '(a b))) - -;;check error trapping -(deftest "meta2" :category "CLUnit-meta" - :input-fn - #'(lambda () (deftest "Error test" :category "CLUnit-pass3" - :test-fn #'(lambda () - (remove-test "Error test") (error "Dummy error")))) - :test-fn #'(lambda (x) (declare (ignore x)) (run-category "CLUnit-pass3")) - :output-fn #'(lambda () (values nil 1 0))) - -;;check input-form -(deftest "testx" :category "CLUnit" - :input-form '(a b c) - :test-fn #'car - :output-fn #'(lambda () 'a)) - -;;check output form -(deftest "testx2" :category "CLUnit" - :input-form '(a b c) - :test-fn #'car - :output-form 'a) - -;;check multiple input-forms -(deftest "testx3" :category "CLUnit" - :input-form (values '(1 2 3) '(10 20 30)) - :test-fn #'(lambda (&rest lists) (car lists)) - :output-fn #'(lambda () '(1 2 3))) - -;;check multiple output-forms -(deftest "testx4" :category "CLUnit" - :input-form (values '(1 2 3) '(10 20 30)) - :test-fn #'(lambda (&rest lists) (apply #'values lists)) - :output-fn #'(lambda () (values '(1 2 3) '(10 20 30)))) - -;;check failed-tests -(deftest "meta5" :category "CLUnit-meta" - :input-fn - #'(lambda () (deftest "Error test" :category "CLUnit-pass4" - :test-fn #'(lambda () - (remove-test "Error test") (error "Dummy error")))) - :test-fn #'(lambda (x) (declare (ignore x)) - (run-category "CLUnit-pass4") - (values (length (failed-tests)) (org.ancar.CLUnit::descr (car (failed-tests))))) - :output-fn #'(lambda () (values 1 "Error test"))) - -(deftest "Test compare-fn" - :test-fn #'(lambda () "abc") - :output-form "abc" - :compare-fn #'(lambda (rlist1 rlist2) - (not (null (reduce #'(lambda (x y) (and x y)) - (mapcar #'string-equal rlist1 rlist2) :initial-value t))))) - -;;; run self test -(when (run-all-tests) - (format t "~&CLUnit self-test passed.~%") - (clear-tests) - (values)))) Only in cl-unit-1.3.1: clunit.lisp~