1 ;;;; miscellaneous side-effectful tests of the MOP
3 ;;;; This software is part of the SBCL system. See the README file for
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
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.
14 ;;; this file attempts to test possible metacircularity issues arising
15 ;;; from changing discriminating functions.
17 (defclass gf1-class
(standard-generic-function) ()
18 (:metaclass sb-mop
:funcallable-standard-class
))
21 (:generic-function-class gf1-class
))
22 (with-test (:name
(:mop-11
1))
23 (assert (= (gf1 3) 3)))
25 (defclass gf2-class
(standard-generic-function) ()
26 (:metaclass sb-mop
:funcallable-standard-class
))
28 (:method
((x number
)) x
)
29 (:generic-function-class gf2-class
))
30 (with-test (:name
(:mop-11
2))
31 (assert (= (gf2 4) 4)))
34 (:method
((x symbol
)) (symbol-name x
))
35 (:generic-function-class gf1-class
))
36 (with-test (:name
(:mop-11
3))
37 (assert (string= (gf1a t
) "T")))
39 (defclass gf3-class
(standard-generic-function) ()
40 (:metaclass sb-mop
:funcallable-standard-class
))
42 (:method
((x number
) (y number
)) (+ x y
))
43 (:generic-function-class gf3-class
))
44 (with-test (:name
(:mop-11
4))
45 (assert (= (gf3 1 2) 3)))