[elephant-cvs] CVS elephant/tests

ieslick ieslick at common-lisp.net
Sun Feb 25 03:40:19 UTC 2007


Update of /project/elephant/cvsroot/elephant/tests
In directory clnet:/tmp/cvs-serv17542/tests

Modified Files:
	testserializer.lisp 
Log Message:
struct serialization test and bugfix

--- /project/elephant/cvsroot/elephant/tests/testserializer.lisp	2007/02/04 10:08:28	1.17
+++ /project/elephant/cvsroot/elephant/tests/testserializer.lisp	2007/02/25 03:40:19	1.18
@@ -332,7 +332,10 @@
 						   (gethash key s2)))))
 		     (standard-object
 		      (%deep-equalp (ele::slots-and-values s1)
-				    (ele::slots-and-values s2)))     
+				    (ele::slots-and-values s2)))
+		     (structure-object
+		      (%deep-equalp (ele::struct-slots-and-values s1)
+				    (ele::struct-slots-and-values s2)))
 		     (t (equalp s1 s2))))))))
       (%deep-equalp thing another))))
 		      
@@ -389,6 +392,26 @@
 						       :slot2 "foo bar"))))
   t t)
 
+(defstruct struct1 ss1 ss2)
+
+(deftest structs
+    (are-not-null
+     (in-out-deep-equalp (make-struct1))
+     (in-out-deep-equalp (make-struct1 :ss1 "test" :ss2 (make-struct1 :ss1 "bottom" :ss2 nil))))
+  t t)
+
+(defstruct (struct2 (:constructor make-a-struct2)) ss3 ss4)
+
+(defmethod struct-constructor ((class (eql 'struct2)))
+  #'make-a-struct2)
+
+(deftest struct-non-std-construct
+    (are-not-null
+     (in-out-deep-equalp (make-a-struct2))
+     (in-out-deep-equalp (make-a-struct2 :ss3 (make-a-struct2 :ss4 "foo"))))
+  t t)
+    
+
 (deftest circular
     (let ((c1 (cons nil nil))
 	  (c2 (cons nil nil))




More information about the Elephant-cvs mailing list