2
;;;; Author: Paul Dietz
3
;;;; Created: Mon May 19 20:07:40 2003
4
;;;; Contains: More tests of structures
8
;;; I realized I had forgotten to test slot override in :include
9
;;; clauses in defstruct.
11
(defstruct struct-include-01a
14
(defstruct (struct-include-01b (:include struct-include-01a
18
(deftest struct-include.1
19
(let ((obj (make-struct-include-01b)))
21
(typep* obj 'struct-include-01a)
22
(typep* obj 'struct-include-01b)
23
(struct-include-01a-a obj)
24
(struct-include-01a-b obj)
25
(struct-include-01b-a obj)
26
(struct-include-01b-b obj)
27
(struct-include-01b-c obj)))
31
(deftest struct-include.2
32
(let ((obj (make-struct-include-01b :a 1 :b 2 :c 3 :d 4)))
34
(typep* obj 'struct-include-01a)
35
(typep* obj 'struct-include-01b)
36
(struct-include-01a-a obj)
37
(struct-include-01a-b obj)
38
(struct-include-01b-a obj)
39
(struct-include-01b-b obj)
40
(struct-include-01b-c obj)
41
(struct-include-01b-d obj)
45
(defstruct struct-include-02a
48
(defstruct (struct-include-02b (:include struct-include-02a
49
(a 10 :type integer))))
51
(deftest struct-include.3
52
(let ((obj (make-struct-include-02b)))
54
(typep* obj 'struct-include-02a)
55
(typep* obj 'struct-include-02b)
56
(struct-include-02a-a obj)
57
(struct-include-02b-a obj)))
60
(deftest struct-include.4
61
(let ((obj (make-struct-include-02a)))
63
(typep* obj 'struct-include-02a)
64
(typep* obj 'struct-include-02b)
65
(struct-include-02a-a obj)))
68
(deftest struct-include.5
69
(let ((obj (make-struct-include-02b :a 100)))
71
(typep* obj 'struct-include-02a)
72
(typep* obj 'struct-include-02b)
73
(struct-include-02a-a obj)
74
(struct-include-02b-a obj)))
77
(defstruct struct-include-03a
80
(defstruct (struct-include-03b (:include struct-include-03a (a))))
82
(deftest struct-include.5a
83
(let ((obj (make-struct-include-03b :a 100)))
85
(typep* obj 'struct-include-03a)
86
(typep* obj 'struct-include-03b)
87
(struct-include-03a-a obj)
88
(struct-include-03b-a obj)))
91
(defstruct struct-include-04a a b)
93
(defstruct (struct-include-04b (:include struct-include-04a
96
(deftest struct-include.6
97
(let ((obj (make-struct-include-04b)))
99
(typep* obj 'struct-include-04a)
100
(typep* obj 'struct-include-04b)
101
(struct-include-04a-a obj)
102
(struct-include-04b-a obj)))
105
(deftest struct-include.7
106
(let ((obj (make-struct-include-04b :a 1 :b 2)))
108
(typep* obj 'struct-include-04a)
109
(typep* obj 'struct-include-04b)
110
(struct-include-04a-a obj)
111
(struct-include-04b-a obj)
112
(struct-include-04a-b obj)
113
(struct-include-04b-b obj)))