Commit df5485c3 authored by pfdietz's avatar pfdietz

Added tests for SLOT-UNBOUND.

parent 64702b24
......@@ -20,6 +20,7 @@
(load "slot-exists-p.lsp")
(load "slot-makunbound.lsp")
(load "slot-missing.lsp")
(load "slot-unbound.lsp")
(load "slot-value.lsp")
(load "method-qualifiers.lsp")
(load "no-applicable-method.lsp")
......
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun Jun 15 06:57:23 2003
;;;; Contains: Tests for SLOT-UNBOUND
(in-package :cl-test)
(defclass slot-unbound-class-01 ()
((a :reader sunb-a)
(b :accessor sunb-b)
(c :writer sunb-c)
(e :reader sunb-e)
(f :reader sunb-f)))
(defmethod slot-unbound ((class t) (obj slot-unbound-class-01) (slot-name t))
(list (class-name class) slot-name))
(deftest slot-unbound.1
(let ((obj (make-instance 'slot-unbound-class-01)))
(values
(slot-value obj 'a)
(slot-value obj 'b)
(slot-value obj 'c)))
(slot-unbound-class-01 a)
(slot-unbound-class-01 b)
(slot-unbound-class-01 c))
(deftest slot-unbound.2
(let ((obj (make-instance 'slot-unbound-class-01)))
(values
(sunb-a obj)
(sunb-b obj)))
(slot-unbound-class-01 a)
(slot-unbound-class-01 b))
(defmethod slot-unbound ((class t) (obj slot-unbound-class-01)
(slot-nake (eql 'e)))
(values))
(defmethod slot-unbound ((class t) (obj slot-unbound-class-01)
(slot-nake (eql 'f)))
(values 1 2 3))
(deftest slot-unbound.3
(slot-value (make-instance 'slot-unbound-class-01) 'e)
nil)
(deftest slot-unbound.4
(slot-value (make-instance 'slot-unbound-class-01) 'f)
1)
(deftest slot-unbound.5
(sunb-e (make-instance 'slot-unbound-class-01))
nil)
(deftest slot-unbound.6
(sunb-f (make-instance 'slot-unbound-class-01))
1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment