Commit 39547c7c authored by pfdietz's avatar pfdietz
Browse files

New tests for + method combination.

parent 94c1c25b
......@@ -43,13 +43,61 @@
(equalt methods (list *cam-gf-01-method4*)))
t)
(defgeneric cam-gf-02 (x))
(deftest compute-applicable-methods.5
(compute-applicable-methods #'cam-gf-02 '(1))
nil)
(defgeneric cam-gf-03 (x)
(:method-combination + :most-specific-first))
(defparameter *cam-gf-03-method1*
(defmethod cam-gf-03 + ((x integer)) 1))
(defparameter *cam-gf-03-method2*
(defmethod cam-gf-03 + ((x rational)) 2))
(defparameter *cam-gf-03-method3*
(defmethod cam-gf-03 + ((x real)) 4))
(defparameter *cam-gf-03-method4*
(defmethod cam-gf-03 + ((x number)) 8))
(defparameter *cam-gf-03-method5*
(defmethod cam-gf-03 + ((x t)) 16))
(deftest compute-applicable-methods.6
(equalt (compute-applicable-methods #'cam-gf-03 (list 0))
(list *cam-gf-03-method1* *cam-gf-03-method2* *cam-gf-03-method3*
*cam-gf-03-method4* *cam-gf-03-method5*))
t)
(defgeneric cam-gf-04 (x)
(:method-combination + :most-specific-last))
(defparameter *cam-gf-04-method1*
(defmethod cam-gf-04 + ((x integer)) 1))
(defparameter *cam-gf-04-method2*
(defmethod cam-gf-04 + ((x rational)) 2))
(defparameter *cam-gf-04-method3*
(defmethod cam-gf-04 + ((x real)) 4))
(defparameter *cam-gf-04-method4*
(defmethod cam-gf-04 + ((x number)) 8))
(defparameter *cam-gf-04-method5*
(defmethod cam-gf-04 + ((x t)) 16))
(deftest compute-applicable-methods.7
(equalt (compute-applicable-methods #'cam-gf-04 (list 0))
(list *cam-gf-04-method1* *cam-gf-04-method2* *cam-gf-04-method3*
*cam-gf-04-method4* *cam-gf-04-method5*))
t)
;;; Need tests with :around, :before, :after methods
;;; Error tests
......@@ -64,6 +112,3 @@
(deftest compute-applicable-methods.error.3
(classify-error (compute-applicable-methods #'cam-gf-01 '(1 2) nil))
program-error)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment