Fix cross build.
[sbcl.git] / tests / mop-11.impure-cload.lisp
blobc312c86ac6dd644899abc909827cf35bec9dbdd8
1 ;;;; miscellaneous side-effectful tests of the MOP
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.
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))
19 (defgeneric gf1 (x)
20 (:method ((x t)) x)
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))
27 (defgeneric gf2 (y)
28 (:method ((x number)) x)
29 (:generic-function-class gf2-class))
30 (with-test (:name (:mop-11 2))
31 (assert (= (gf2 4) 4)))
33 (defgeneric gf1a (x)
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))
41 (defgeneric gf3 (x y)
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)))