Commit 8d5dc369 authored by pfdietz's avatar pfdietz
Browse files

Add method to describe-object

parent c3f038f1
......@@ -34,7 +34,8 @@
(loop for x in *universe*
for s1 = nil
for s2 = nil
for s3 = (with-output-to-string (s) (setf (values s1 s2) (harness-for-describe #'(lambda () (describe x s)))))
for s3 = (with-output-to-string (s)
(setf (values s1 s2) (harness-for-describe #'(lambda () (describe x s)))))
when (or (equal s3 "") (not (equal "" s2)) (not (equal "" s1)))
collect (list x s1 s2 s3))
......@@ -53,6 +54,22 @@
collect (list x s1 s2))
;;; Defining methods for describe-object
(defclass describe-object-test-class-01 () ((s1 :initarg :s1) (s2 :initarg :s2) (s3 :initarg :s3)))
(defmethod describe-object ((obj describe-object-test-class-01) stream)
(format stream "ABCDE ~A ~A ~A XYZ" (slot-value obj 's1) (slot-value obj 's2) (slot-value obj 's3)))
(deftest describe.5
(let ((obj (make-instance 'describe-object-test-class-01 :s1 2 :s2 6 :s3 17)))
(multiple-value-bind (str1 str2) (harness-for-describe #'(lambda () (describe obj)))
(if (or (search "ABCDE 2 6 17 XYZ" str1)
(search "ABCDE 2 6 17 XYZ" str2))
(list str1 str2))))
;;; Error cases
(deftest describe.error.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