stripped down version of LIFT, code and examples, not whole repo.
[CommonLispStat.git] / external / lift.darcs / test / finding-tests.lisp
blobb798ff7ac80b2de323b12a06b5ab7d7be48cd197
1 (in-package #:lift-test)
3 ;;; ---------------------------------------------------------------------------
4 ;;; lift-test-ensure
5 ;;; make sure that ensure and its friends work as expected
6 ;;;
7 ;;; The strategy here is to pair "regular" tests with meta-tests. The
8 ;;; regular tests are normal tests written using LIFT. The meta-tests
9 ;;; use run-tests or run-tests to run the regular test and then grovel
10 ;;; over the returned test-result to make sure it contains what it is
11 ;;; supposed to.
12 ;;; ---------------------------------------------------------------------------
14 (defpackage #:one-test-package
15 (:use #:common-lisp #:lift))
17 (defpackage #:two-test-package
18 (:use #:common-lisp #:lift))
20 (deftestsuite one-test-package::test-finding () ())
22 (deftestsuite two-test-package::test-finding () ())
24 (deftestsuite test-find-test-suite (lift-test) ())
26 (addtest (test-find-test-suite)
27 simple-searching
28 (ensure-same (lift::find-testsuite 'test-find-test-suite)
29 'test-find-test-suite)
30 (ensure-same (lift::find-testsuite 'one-test-package::test-finding)
31 'one-test-package::test-finding)
32 (ensure-same (lift::find-testsuite 'two-test-package::test-finding)
33 'two-test-package::test-finding))
35 (addtest (test-find-test-suite)
36 not-such-suite
37 (ensure-condition lift::test-class-not-defined
38 (lift::find-testsuite (gensym))))
40 (addtest (test-find-test-suite)
41 two-many-tests
42 (ensure-error (lift::find-testsuite "test-finding")))