standard-generic-function.lsp 898 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Tue May 20 06:47:20 2003
;;;; Contains: Additional tests for class STANDARD-GENERIC-FUNCTION

(in-package :cl-test)

;;; Most tests of this are elsewhere

(unless (typep #'cons 'generic-function)

(deftest standard-generic-function.1
  (progn
    (eval
     '(defgeneric sgf-cpl-gf.1 (x)
sds's avatar
sds committed
16
17
18
        (:method ((x generic-function)) 1)
        (:method ((x function)) 2)
        (:method ((x t)) 3)))
19
20
21
22
23
24
25
26
27
28
    (values
     (sgf-cpl-gf.1 #'make-instance)
     (sgf-cpl-gf.1 #'cons)
     (sgf-cpl-gf.1 'a)))
  1 2 3)

(deftest standard-generic-function.2
  (progn
    (eval
     '(defgeneric sgf-cpl-gf.2 (x)
sds's avatar
sds committed
29
30
31
        (:method ((x standard-generic-function)) 1)
        (:method ((x function)) 2)
        (:method ((x t)) 3)))
32
33
34
35
36
37
38
39
40
41
42
43
    (values
     (sgf-cpl-gf.2 #'make-instance)
     (sgf-cpl-gf.2 #'cons)
     (sgf-cpl-gf.2 'a)))
  1 2 3)


)




sds's avatar
sds committed
44
45