/
test-conditions.lisp
47 lines (37 loc) · 1.48 KB
/
test-conditions.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(in-package #:lift-test)
(deftestsuite test-normal-conditions (lift-test)
())
(deftestsuite test-normal-conditions-helper (lift-test)
())
(define-condition test-simple-condition-condition-1 () ())
(define-condition test-simple-condition-condition-2 () ())
(addtest (test-normal-conditions-helper)
signal-simple-condition-1
(ensure-condition test-simple-condition-condition-2
(signal 'test-simple-condition-condition-1)
(signal 'test-simple-condition-condition-2)))
(addtest (test-normal-conditions-helper)
signal-simple-condition-2
(ensure-condition test-simple-condition-condition-2
(signal 'test-simple-condition-condition-2)
(signal 'test-simple-condition-condition-1)))
(deftestsuite test-normal-conditions-helper-2 (lift-test)
())
(addtest (test-normal-conditions-helper-2)
signal-simple-condition-1
(ensure-condition (test-simple-condition-condition-1
:catch-all-conditions? t)
(signal 'test-simple-condition-condition-1)
(signal 'test-simple-condition-condition-2)))
(addtest (test-normal-conditions)
test-1
(let ((r (run-tests :suite 'test-normal-conditions-helper)))
(ensure-same (length (tests-run r)) 2 :test '=)
(ensure-same (length (failures r)) 0)
(ensure-same (length (errors r)) 0)))
(addtest (test-normal-conditions)
test-2
(let ((r (run-tests :suite 'test-normal-conditions-helper-2)))
(ensure-same (length (tests-run r)) 1 :test '=)
(ensure-same (length (failures r)) 0)
(ensure-same (length (errors r)) 0)))