File: standard-generic-function.lsp

package info (click to toggle)
cl-ansi-tests 20071218-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,000 kB
  • ctags: 22,025
  • sloc: lisp: 134,798; makefile: 144
file content (45 lines) | stat: -rw-r--r-- 864 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;-*- 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)
	(:method ((x generic-function)) 1)
	(:method ((x function)) 2)
	(:method ((x t)) 3)))
    (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)
	(:method ((x standard-generic-function)) 1)
	(:method ((x function)) 2)
	(:method ((x t)) 3)))
    (values
     (sgf-cpl-gf.2 #'make-instance)
     (sgf-cpl-gf.2 #'cons)
     (sgf-cpl-gf.2 'a)))
  1 2 3)


)