source: trunk/source/tests/ansi-tests/method-qualifiers.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun May 11 07:14:12 2003
4;;;; Contains: Tests of METHOD-QUALIFIERS
5
6(in-package :cl-test)
7
8(defgeneric mq-generic-function (x))
9
10(defparameter *mq-method-1*
11  (defmethod mq-generic-function ((x integer)) (1+ x)))
12
13(deftest method-qualifiers.1
14  (method-qualifiers *mq-method-1*)
15  nil)
16
17(defclass mq-class-01 ()
18  (a b c))
19
20(defparameter *mq-method-2*
21  (defmethod mq-generic-function :before ((x mq-class-01))
22    'foo))
23
24(deftest method-qualifiers.2
25  (method-qualifiers *mq-method-2*)
26  (:before))
27
28(defclass mq-class-02 ()
29  (e f g))
30
31(defparameter *mq-method-3*
32  (defmethod mq-generic-function :after ((x mq-class-02))
33    'foo))
34
35(deftest method-qualifiers.3
36  (method-qualifiers *mq-method-3*)
37  (:after))
38
39(defclass mq-class-03 ()
40  (h i j))
41
42(defparameter *mq-method-4*
43  (defmethod mq-generic-function :around ((x mq-class-03))
44    'foo))
45
46(deftest method-qualifiers.4
47  (method-qualifiers *mq-method-4*)
48  (:around))
49
50;;; Need tests on user-defined method combinations
51
52(deftest method-qualifiers.error.1
53  (signals-error (method-qualifiers) program-error)
54  t)
55
56(deftest method-qualifiers.error.2
57  (signals-error (method-qualifiers *mq-method-4* nil) program-error)
58  t)
Note: See TracBrowser for help on using the repository browser.