Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Karsten Poeck
ansi-test
Commits
5bfae893
Commit
5bfae893
authored
May 03, 2003
by
pfdietz
Browse files
Tests of :before methods for shared-initialize.
parent
a9a2cbc4
Changes
1
Show whitespace changes
Inline
Side-by-side
ansi-tests/shared-initialize.lsp
View file @
5bfae893
...
...
@@ -550,6 +550,38 @@
(t t)
z z)
;;; Before methods fill in slots before the default system method
(defclass shared-init-class-07 ()
((a :initform 'x)
(b :initform 'y)))
(defmethod shared-initialize :before ((obj shared-init-class-07) slot-names &rest args)
(declare (ignore args slot-names))
(setf (slot-value obj 'a) 'foo)
obj)
(deftest shared-initialize.7.1
(let* ((class (find-class 'shared-init-class-07))
(obj (allocate-instance class)))
(values
(map-slot-boundp* obj '(a b))
(eqt obj (shared-initialize obj nil))
(map-slot-boundp* obj '(a b))
(slot-value obj 'a)))
(nil nil) t (t nil) foo)
(deftest shared-initialize.7.2
(let* ((class (find-class 'shared-init-class-07))
(obj (allocate-instance class)))
(values
(map-slot-boundp* obj '(a b))
(eqt obj (shared-initialize obj t))
(map-slot-boundp* obj '(a b))
(slot-value obj 'a)
(slot-value obj 'b)))
(nil nil) t (t t) foo y)
;;; Error tests
(deftest shared-initialize.error.1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment