no-next-method.lsp 1.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sun May 11 14:41:50 2003
;;;; Contains: Tests of NO-NEXT-METHOD

(in-package :cl-test)

(defgeneric no-next-meth-gf-01 (x))

(defmethod no-next-meth-gf-01 ((x integer))
  (call-next-method))

(defmethod no-next-meth-gf-01 :around ((x character))
  (call-next-method))

(deftest no-next-method.1
  (handler-case (progn (no-next-meth-gf-01 10) :bad)
sds's avatar
sds committed
18
                (error () :good))
19 20 21 22
  :good)

(deftest no-next-method.2
  (handler-case (progn (no-next-meth-gf-01 ) :bad)
sds's avatar
sds committed
23
                (error () :good))
24 25
  :good)

26 27
;;; (defparameter *no-next-meth-gf-02*
;;;   (defgeneric no-next-meth-gf-02 (x)))
sds's avatar
sds committed
28
;;;
29 30
;;; (defmethod no-next-meth-gf-02 ((x integer))
;;;   (call-next-method))
sds's avatar
sds committed
31
;;;
32 33
;;; (defmethod no-next-meth-gf-02 :around ((x character))
;;;   (call-next-method))
sds's avatar
sds committed
34
;;;
35
;;; (defmethod no-next-method ((gf (eql *no-next-meth-gf-02*))
sds's avatar
sds committed
36 37
;;;                        (method standard-method)
;;;                        &rest args)
38
;;;   (values (copy-list args) :aborted))
sds's avatar
sds committed
39
;;;
40 41 42
;;; (deftest no-next-method.3
;;;   (no-next-meth-gf-02 10)
;;;   (10) :aborted)
sds's avatar
sds committed
43
;;;
44 45 46
;;; (deftest no-next-method.4
;;;   (no-next-meth-gf-02 #\a)
;;;   (#\a) :aborted)