Commit 335a07ee authored by pfdietz's avatar pfdietz
Browse files

Added tests for COPY-STRUCTURE

parent 8f742603
...@@ -364,7 +364,7 @@ do the defstruct." ...@@ -364,7 +364,7 @@ do the defstruct."
`((deftest ,(make-struct-test-name name 9) `((deftest ,(make-struct-test-name name 9)
,(let* ((var 'XTEMP-9) ,(let* ((var 'XTEMP-9)
(var2 'YTEMP-9) (var2 'YTEMP-9)
(var3 'ZTEMP-9)) (var3 'ZTEMP-9))
`(let ((,var (,make-fn `(let ((,var (,make-fn
,@(loop ,@(loop
for (slot-name . initval) for (slot-name . initval)
...@@ -470,6 +470,30 @@ do the defstruct." ...@@ -470,6 +470,30 @@ do the defstruct."
(let ((doc (documentation ',name 'type))) (let ((doc (documentation ',name 'type)))
(or (null doc) (equalt doc ',doc-string))) (or (null doc) (equalt doc ',doc-string)))
t)) t))
;; Test that COPY-STRUCTURE works, if this is a structure
;; type
,@(unless type-option
`((deftest ,(make-struct-test-name name 20)
,(let* ((var 'XTEMP-20)
(var2 'YTEMP-20))
`(let ((,var (,make-fn
for (slot-name . initval)
in initial-value-alist
nconc (list (intern (string slot-name)
`(quote ,initval))))))
(let ((,var2 (copy-structure ,var)))
(not (eqlt ,var ,var2))
for (slot-name . nil) in initial-value-alist
for fn in field-fns
`(eqlt (,fn ,var) (,fn ,var2)))
nil nil
))) )))
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