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
cd1bf879
Commit
cd1bf879
authored
May 10, 2003
by
pfdietz
Browse files
Begin adding tests for slot-exists-p.
parent
deaa9945
Changes
2
Hide whitespace changes
Inline
Side-by-side
ansi-tests/load-objects.lsp
View file @
cd1bf879
...
...
@@ -17,5 +17,4 @@
(load "change-class.lsp")
(load "update-instance-for-different-class.lsp")
(load "slot-boundp.lsp")
(load "slot-exists-p.lsp")
ansi-tests/slot-exists-p.lsp
0 → 100644
View file @
cd1bf879
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat May 10 09:39:01 2003
;;;; Contains: Tests of SLOT-EXISTS-P
(in-package :cl-test)
;;; This function is also tested incidentally in many other files
(defclass slot-exists-p-class-01 ()
(a (b :allocation :class) (c :allocation :instance)))
(deftest slot-exists-p.1
(let ((obj (allocate-instance (find-class 'slot-exists-p-class-01))))
(notnot-mv (slot-exists-p obj 'a)))
t)
(deftest slot-exists-p.2
(let ((obj (allocate-instance (find-class 'slot-exists-p-class-01))))
(notnot-mv (slot-exists-p obj 'b)))
t)
(deftest slot-exists-p.3
(let ((obj (allocate-instance (find-class 'slot-exists-p-class-01))))
(notnot-mv (slot-exists-p obj 'c)))
t)
(deftest slot-exists-p.4
(let ((obj (allocate-instance (find-class 'slot-exists-p-class-01))))
(slot-exists-p obj 'd))
nil)
(deftest slot-exists-p.5
(let ((obj (allocate-instance (find-class 'slot-exists-p-class-01))))
(slot-exists-p obj (gensym)))
nil)
(deftest slot-exists-p.6
(let ((obj (allocate-instance (find-class 'slot-exists-p-class-01))))
(slot-exists-p obj nil))
nil)
(deftest slot-exists-p.7
(let ((obj (allocate-instance (find-class 'slot-exists-p-class-01))))
(slot-exists-p obj t))
nil)
;;; SLOT-EXISTS-P may be called on any object, not just on standard objects
(deftest slot-exists-p.8
(let ((slot-name (gensym)))
(loop for x in *universe*
when (slot-exists-p x slot-name)
collect x))
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