/[gcl]/gcl/ansi-tests/defgeneric.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/defgeneric.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pfdietz, Sun May 18 23:34:21 2003 UTC revision 1.4 by pfdietz, Mon May 19 13:09:37 2003 UTC
# Line 68  Line 68 
68  (deftest defgeneric.error.8  (deftest defgeneric.error.8
69    (classify-error (defgeneric defgeneric-error-fn.8 (x y)    (classify-error (defgeneric defgeneric-error-fn.8 (x y)
70                      (:argument-precedence-order x)))                      (:argument-precedence-order x)))
   program-error)  
71      program-error)
72    
73    
74    ;;; Non error cases
75    
76    (deftest defgeneric.1
77      (let ((fn (eval '(defgeneric defgeneric.fun.1 (x y z)
78                         (:method ((x t) (y t) (z t)) (list x y z))))))
79        (values
80         (typep* fn 'generic-function)
81         (funcall fn 'a 'b 'c)
82         (defgeneric.fun.1 'd 'e 'f)))
83      t (a b c) (d e f))
84    
85    (deftest defgeneric.2
86      (let ((fn (eval '(defgeneric defgeneric.fun.2 (x y z)
87                         (:documentation "boo!")
88                         (:method ((x t) (y t) (z t)) (vector x y z))))))
89        (values
90         (typep* fn 'generic-function)
91         (funcall fn 'a 'b 'c)
92         (defgeneric.fun.2 'd 'e 'f)
93         (let ((doc (documentation fn t)))
94           (or (not doc)
95               (and (stringp doc) (string=t doc "boo!"))))
96         (let ((doc (documentation fn 'function)))
97           (or (not doc)
98               (and (stringp doc) (string=t doc "boo!"))))))
99        
100      t #(a b c) #(d e f) t t)
101    
102    (deftest defgeneric.3
103      (let ((fn (eval '(defgeneric defgeneric.fun.3 (x y)
104                         (:method ((x t) (y symbol)) (list x y))
105                         (:method ((x symbol) (y t)) (list y x))))))
106        (values
107         (typep* fn 'generic-function)
108         (funcall fn 1 'a)
109         (funcall fn 'b 2)
110         (funcall fn 'a 'b)))
111      t
112      (1 a)
113      (2 b)
114      (b a))
115    
116    (deftest defgeneric.4
117      (let ((fn (eval '(defgeneric defgeneric.fun.4 (x y)
118                         (:argument-precedence-order y x)
119                         (:method ((x t) (y symbol)) (list x y))
120                         (:method ((x symbol) (y t)) (list y x))))))
121        (values
122         (typep* fn 'generic-function)
123         (funcall fn 1 'a)
124         (funcall fn 'b 2)
125         (funcall fn 'a 'b)))
126      t
127      (1 a)
128      (2 b)
129      (a b))

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26