Skip to content
GitLab
Projects
Groups
Snippets
/
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
64702b24
Commit
64702b24
authored
Jun 15, 2003
by
pfdietz
Browse files
Added tests for SLOT-MISSING.
parent
cc13e5d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
ansi-tests/load-objects.lsp
View file @
64702b24
...
...
@@ -19,6 +19,7 @@
(load "slot-boundp.lsp")
(load "slot-exists-p.lsp")
(load "slot-makunbound.lsp")
(load "slot-missing.lsp")
(load "slot-value.lsp")
(load "method-qualifiers.lsp")
(load "no-applicable-method.lsp")
...
...
ansi-tests/slot-missing.lsp
0 → 100644
View file @
64702b24
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun Jun 15 06:03:58 2003
;;;; Contains: Tests of SLOT-MISSING
(in-package :cl-test)
(defclass slot-missing-class-01 ()
(a b c))
(defmethod slot-missing ((class t) (obj slot-missing-class-01)
(slot-name t) (operation t)
&optional (new-value nil new-value-p))
(list slot-name operation new-value (notnot new-value-p)))
(deftest slot-missing.1
(let ((obj (make-instance 'slot-missing-class-01)))
(slot-value obj 'foo))
(foo slot-value nil nil))
(deftest slot-missing.2
(let ((obj (make-instance 'slot-missing-class-01)))
(setf (slot-value obj 'foo) 'bar))
(foo setf bar t))
(deftest slot-missing.3
(let ((obj (make-instance 'slot-missing-class-01)))
(slot-makunbound obj 'xyz))
(xyz slot-makunbound nil nil))
(deftest slot-missing.4
(let ((obj (make-instance 'slot-missing-class-01)))
(slot-boundp obj 'abc))
(abc slot-boundp nil nil))
(deftest slot-missing.5
(let ((obj (make-instance 'slot-missing-class-01)))
(slot-value obj 'd))
(d slot-value nil nil))
(deftest slot-missing.6
(let ((obj (make-instance 'slot-missing-class-01)))
(setf (slot-value obj 'd) 'bar))
bar)
(deftest slot-missing.7
(let* ((obj (make-instance 'slot-missing-class-01))
(val (slot-makunbound obj 'd)))
(if (eq val obj)
:good
val))
:good)
(defmethod slot-missing ((class t) (obj slot-missing-class-01)
(slot-name (eql 'not-there))
(operation (eql 'slot-boundp))
&optional new-value)
(declare (ignore new-value))
(values nil :ignore-this))
(deftest slot-missing.8
(let* ((obj (make-instance 'slot-missing-class-01)))
(slot-boundp obj 'not-there))
nil)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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