sb-introspect:find-definition-sources-by-name: support globals.
[sbcl.git] / contrib / sb-introspect / test.lisp
1
2 ;;;
3 ;;; The order of the forms must not change, as the order is checked in
4 ;;; `test-driver.lisp'. Thus do not alter this file unless you edit
5 ;;; test-driver.lisp to match.
6 ;;;
7
8 (declaim (optimize (debug 3)))
9 (in-package :cl-user)
10
11 (defun one (a b c) (+ a b c))
12
13 (defgeneric two (a b))
14 (defmethod two ((a number) b)
15   (* 2 a))
16
17 (defstruct three four five)
18
19 (with-compilation-unit (:source-plist (list :test-inner "IN"))
20   (eval '(defun four () 4)))
21
22 "oops-off-by-one"
23
24 (defparameter *a* 1)
25
26 (defvar *b* 2)
27
28 (defclass a ()
29   (a))
30
31 (define-condition b (warning) (a))
32
33 (defstruct c e f)
34
35 (defstruct (d (:type list)) e f)
36
37 (defpackage e (:use :cl))
38
39 (define-symbol-macro f 'e)
40
41 (deftype g () 'fixnum)
42
43 (defconstant +h+ 1)
44
45 (defmethod j ((a t))
46   2)
47
48 (defmethod j ((b null))
49   2)
50
51 (defmacro l (a)
52   a)
53
54 (define-compiler-macro m (a)
55   (declare (ignore a))
56   'b)
57
58 (defsetf n (a) (store)
59   (format t "~a ~a~%" a store))
60
61 (defun (setf o) (x)
62   (print x))
63
64 (defmethod (setf p) (x y)
65   (format t "~a ~a~%" x y))
66
67 (define-modify-macro q (x) logand)
68
69 (define-method-combination r nil)
70
71 (define-setf-expander s (a b)
72   (format t "~a ~a~%" a b))
73
74 (eval-when (:compile-toplevel)
75   (defun compile-time-too-fun ()
76     :foo))
77
78 (sb-ext:defglobal **global** 'value)