15 |
(defparameter *find-method-gf-01-method4* |
(defparameter *find-method-gf-01-method4* |
16 |
(defmethod find-method-gf-01 ((x t)) 'd)) |
(defmethod find-method-gf-01 ((x t)) 'd)) |
17 |
|
|
18 |
(deftest find-method.2 |
(deftest find-method.1 |
19 |
(eqt (find-method #'find-method-gf-01 nil (list (find-class 'integer))) |
(eqt (find-method #'find-method-gf-01 nil (list (find-class 'integer))) |
20 |
*find-method-gf-01-method1*) |
*find-method-gf-01-method1*) |
21 |
t) |
t) |
22 |
|
|
23 |
(deftest find-method.4 |
(deftest find-method.2 |
24 |
(eqt (find-method #'find-method-gf-01 nil (list (find-class 'rational))) |
(eqt (find-method #'find-method-gf-01 nil (list (find-class 'rational))) |
25 |
*find-method-gf-01-method2*) |
*find-method-gf-01-method2*) |
26 |
t) |
t) |
27 |
|
|
28 |
(deftest find-method.6 |
(deftest find-method.3 |
29 |
(eqt (find-method #'find-method-gf-01 nil (list (find-class 'real))) |
(eqt (find-method #'find-method-gf-01 nil (list (find-class 'real))) |
30 |
*find-method-gf-01-method3*) |
*find-method-gf-01-method3*) |
31 |
t) |
t) |
32 |
|
|
33 |
(deftest find-method.8 |
(deftest find-method.4 |
34 |
(eqt (find-method #'find-method-gf-01 nil (list (find-class t))) |
(eqt (find-method #'find-method-gf-01 nil (list (find-class t))) |
35 |
*find-method-gf-01-method4*) |
*find-method-gf-01-method4*) |
36 |
t) |
t) |
37 |
|
|
38 |
(deftest find-method.9 |
(deftest find-method.5 |
39 |
(find-method #'find-method-gf-01 (list :around) (list (find-class t)) |
(find-method #'find-method-gf-01 (list :around) (list (find-class t)) |
40 |
nil) |
nil) |
41 |
nil) |
nil) |
42 |
|
|
43 |
(deftest find-method.10 |
(deftest find-method.6 |
44 |
(find-method #'find-method-gf-01 (list :after) |
(find-method #'find-method-gf-01 (list :after) |
45 |
(list (find-class 'integer)) nil) |
(list (find-class 'integer)) nil) |
46 |
nil) |
nil) |
47 |
|
|
48 |
(deftest find-method.11 |
(deftest find-method.7 |
49 |
(find-method #'find-method-gf-01 (list :before) (list (find-class 'real)) |
(find-method #'find-method-gf-01 (list :before) (list (find-class 'real)) |
50 |
nil) |
nil) |
51 |
nil) |
nil) |
52 |
|
|
53 |
|
;;; EQL specializers |
54 |
|
|
55 |
|
(defgeneric find-method-gf-02 (x)) |
56 |
|
|
57 |
|
(defparameter *find-method-gf-02-method1* |
58 |
|
(defmethod find-method-gf-02 ((x (eql 1234567890))) 'a)) |
59 |
|
|
60 |
|
(defparameter *find-method-02-method2-value* (list 'a)) |
61 |
|
|
62 |
|
(defparameter *find-method-gf-02-method2* |
63 |
|
(defmethod find-method-gf-02 ((x (eql *find-method-02-method2-value*))) |
64 |
|
'b)) |
65 |
|
|
66 |
|
(deftest find-method.8 |
67 |
|
(eqt (find-method #'find-method-gf-02 nil (list '(eql 1234567890))) |
68 |
|
*find-method-gf-02-method1*) |
69 |
|
t) |
70 |
|
|
71 |
|
(deftest find-method.9 |
72 |
|
(eqt (find-method #'find-method-gf-02 nil |
73 |
|
(list (list 'eql *find-method-02-method2-value*))) |
74 |
|
*find-method-gf-02-method2*) |
75 |
|
t) |
76 |
|
|
77 |
|
;;; Error tests |
78 |
|
|
79 |
(deftest find-method.error.1 |
(deftest find-method.error.1 |
80 |
(classify-error (find-method)) |
(classify-error (find-method)) |
81 |
program-error) |
program-error) |