/[gcl]/gcl/ansi-tests/slot-missing.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/slot-missing.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by pfdietz, Sun Jun 15 11:42:44 2003 UTC revision 1.2 by pfdietz, Sun Jun 15 13:55:35 2003 UTC
# Line 5  Line 5 
5    
6  (in-package :cl-test)  (in-package :cl-test)
7    
8  (defclass slot-missing-class-01 ()  (defparameter *slot-missing-class-01-var* nil)
9    (a b c))  
10    (defclass slot-missing-class-01 () (a b c))
11    
12  (defmethod slot-missing ((class t) (obj slot-missing-class-01)  (defmethod slot-missing ((class t) (obj slot-missing-class-01)
13                           (slot-name t) (operation t)                           (slot-name t) (operation t)
14                           &optional (new-value nil new-value-p))                           &optional (new-value nil new-value-p))
15    (list slot-name operation new-value (notnot new-value-p)))    (setf *slot-missing-class-01-var*
16            (list slot-name operation new-value (notnot new-value-p))))
17    
18  (deftest slot-missing.1  (deftest slot-missing.1
19    (let ((obj (make-instance 'slot-missing-class-01)))    (let ((obj (make-instance 'slot-missing-class-01)))
20      (slot-value obj 'foo))      (values
21         (slot-value obj 'foo)
22         *slot-missing-class-01-var*))
23      (foo slot-value nil nil)
24    (foo slot-value nil nil))    (foo slot-value nil nil))
25    
26  (deftest slot-missing.2  (deftest slot-missing.2
27    (let ((obj (make-instance 'slot-missing-class-01)))    (let ((obj (make-instance 'slot-missing-class-01)))
28      (setf (slot-value obj 'foo) 'bar))      (values
29         (setf (slot-value obj 'foo) 'bar)
30         *slot-missing-class-01-var*))
31      bar
32    (foo setf bar t))    (foo setf bar t))
33    
34  (deftest slot-missing.3  (deftest slot-missing.3
35    (let ((obj (make-instance 'slot-missing-class-01)))    (let ((obj (make-instance 'slot-missing-class-01)))
36      (slot-makunbound obj 'xyz))      (values
37         (eqt obj (slot-makunbound obj 'xyz))
38         *slot-missing-class-01-var*))
39      t
40    (xyz slot-makunbound nil nil))    (xyz slot-makunbound nil nil))
41    
42  (deftest slot-missing.4  (deftest slot-missing.4
43    (let ((obj (make-instance 'slot-missing-class-01)))    (let ((obj (make-instance 'slot-missing-class-01)))
44      (slot-boundp obj 'abc))      (values
45         (notnot (slot-boundp obj 'abc))
46         *slot-missing-class-01-var*))
47      t
48    (abc slot-boundp nil nil))    (abc slot-boundp nil nil))
49    
50  (deftest slot-missing.5  (deftest slot-missing.5
# Line 62  Line 76 
76    (let* ((obj (make-instance 'slot-missing-class-01)))    (let* ((obj (make-instance 'slot-missing-class-01)))
77      (slot-boundp obj 'not-there))      (slot-boundp obj 'not-there))
78    nil)    nil)
   
   
   
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26