0.7.8.32:
[sbcl.git] / tests / mop.impure.lisp
1 ;;;; miscellaneous side-effectful tests of the MOP
2
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; from CMU CL.
9 ;;;; 
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
13
14 ;;;; Note that the MOP is not in a supported state. Package issues
15 ;;;; (both MOP/SB-PCL and CL/SB-PCL) have yet to be resolved, and
16 ;;;; there is likely to be missing functionality.  However, this seems
17 ;;;; a good a way as any of ensuring that we have no regressions.
18
19 (defpackage "MOP-TEST"
20   ;; eventually, we might want "MOP" as well here.
21   (:use "CL"))
22
23 (in-package "MOP-TEST")
24
25 (defgeneric fn-with-odd-arg-precedence (a b c)
26   (:argument-precedence-order b c a))
27
28 (assert (equal
29          (sb-pcl:generic-function-lambda-list #'fn-with-odd-arg-precedence)
30          '(a b c)))
31 (assert (equal
32          (sb-pcl:generic-function-argument-precedence-order #'fn-with-odd-arg-precedence)
33          '(b c a)))
34
35 #||
36 This is actually a test of vanilla CLOS, not the MOP; however, there isn't
37 a terribly easy way of testing this without it (FIXME: one would have to
38 construct a series of DOCUMENTATION methods, probably involving
39 CALL-NEXT-METHOD). However, since we're actually getting this wrong
40 currently, better put in a quick test in the hope that we can fix it soon:
41
42 (assert (equal
43          (sb-pcl:generic-function-argument-precedence-order #'documentation)
44          (let ((ll (sb-pcl:generic-function-lambda-list #'documentation)))
45            (list (nth ll 1) (nth ll 0)))))
46 ||#
47 \f
48 ;;;; success
49 (sb-ext:quit :unix-status 104)