Skip to content
Snippets Groups Projects
Commit 4f176076 authored by pfdietz's avatar pfdietz
Browse files

Enhanced the bad method qualifier tests to call the generic function, in case...

Enhanced the bad method qualifier tests to call the generic function, in case the error is signaled at effective method computation time.
parent ba7434a4
No related branches found
No related tags found
No related merge requests found
...@@ -66,36 +66,39 @@ ...@@ -66,36 +66,39 @@
(defgeneric dmc-gf-03 (x) (:method-combination times)) (defgeneric dmc-gf-03 (x) (:method-combination times))
(deftest define-method-combination-03.1 (deftest define-method-combination-03.1
(handler-case (prog1
(progn (handler-case
(eval '(defmethod dmc-gf-03 ((x integer)) t)) (progn
:bad) (eval '(defmethod dmc-gf-03 ((x integer)) t))
(error () (eval '(dmc-gf-03 1))
(dolist (meth (compute-applicable-methods #'dmc-gf-03 (list 1))) :bad)
(remove-method #'dmc-gf-03 meth)) (error () :good))
:good)) (dolist (meth (compute-applicable-methods #'dmc-gf-03 (list 1)))
(remove-method #'dmc-gf-03 meth)))
:good) :good)
(deftest define-method-combination-03.2 (deftest define-method-combination-03.2
(handler-case (prog1
(progn (handler-case
(eval '(defmethod dmc-gf-03 :before ((x cons)) t)) (progn
:bad) (eval '(defmethod dmc-gf-03 :before ((x cons)) t))
(error () (eval '(dmc-gf-03 (cons 'a 'b)))
(dolist (meth (compute-applicable-methods #'dmc-gf-03 (list '(a)))) :bad)
(remove-method #'dmc-gf-03 meth)) (error () :good))
:good)) (dolist (meth (compute-applicable-methods #'dmc-gf-03 (list '(a))))
(remove-method #'dmc-gf-03 meth)))
:good) :good)
(deftest define-method-combination-03.3 (deftest define-method-combination-03.3
(handler-case (prog1
(progn (handler-case
(eval '(defmethod dmc-gf-03 :after ((x symbol)) t)) (progn
:bad) (eval '(defmethod dmc-gf-03 :after ((x symbol)) t))
(error () (eval '(dmc-gf-03 'a))
(dolist (meth (compute-applicable-methods #'dmc-gf-03 (list 'a))) :bad)
(remove-method #'dmc-gf-03 meth)) (error () :good))
:good)) (dolist (meth (compute-applicable-methods #'dmc-gf-03 (list 'a)))
(remove-method #'dmc-gf-03 meth)))
:good) :good)
(define-method-combination times2 (define-method-combination times2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment