Revert "Update README.md"
[lift.git] / test / test-conditions.lisp
blobc4e6019d64205515e0571c9e1130f46a93079b89
1 (in-package #:lift-test)
3 (deftestsuite test-normal-conditions (lift-test)
4 ())
6 (deftestsuite test-normal-conditions-helper (lift-test)
7 ())
9 (define-condition test-simple-condition-condition-1 () ())
11 (define-condition test-simple-condition-condition-2 () ())
13 (addtest (test-normal-conditions-helper)
14 signal-simple-condition-1
15 (ensure-condition test-simple-condition-condition-2
16 (signal 'test-simple-condition-condition-1)
17 (signal 'test-simple-condition-condition-2)))
19 (addtest (test-normal-conditions-helper)
20 signal-simple-condition-2
21 (ensure-condition test-simple-condition-condition-2
22 (signal 'test-simple-condition-condition-2)
23 (signal 'test-simple-condition-condition-1)))
25 (deftestsuite test-normal-conditions-helper-2 (lift-test)
26 ())
28 (addtest (test-normal-conditions-helper-2)
29 signal-simple-condition-1
30 (ensure-condition (test-simple-condition-condition-1
31 :catch-all-conditions? t)
32 (signal 'test-simple-condition-condition-1)
33 (signal 'test-simple-condition-condition-2)))
35 (addtest (test-normal-conditions)
36 test-1
37 (let ((r (run-tests :suite 'test-normal-conditions-helper)))
38 (ensure-same (length (tests-run r)) 2 :test '=)
39 (ensure-same (length (failures r)) 0)
40 (ensure-same (length (errors r)) 0)))
42 (addtest (test-normal-conditions)
43 test-2
44 (let ((r (run-tests :suite 'test-normal-conditions-helper-2)))
45 (ensure-same (length (tests-run r)) 1 :test '=)
46 (ensure-same (length (failures r)) 0)
47 (ensure-same (length (errors r)) 0)))