- :dob (get-universal-time)
- :addresses (list home office)
- :resume "Style & Grace"))
+ :dob (encode-universal-time
+ 1 2 3 4 5 2000)
+ :addresses (list home office)
+ :resume "Style & Grace"))
+
+
+(defun view-to-string (obj &rest args)
+ (with-output-to-string (strm)
+ (apply #'view obj :stream strm args)))
+
+(rem-all-tests)
+
+(deftest :p1 (view-to-string mary :vid :compact-text) "Person:
+ Mary Jackson Thu, 4 May 2000 03:02:01 Style & Grace
+")
+
+(deftest :p2 (view-to-string mary :subobjects t :vid :compact-text) "Person:
+ Mary Jackson Thu, 4 May 2000 03:02:01 Style & Grace
+ Addresses:
+ Home 321 Shady Lane 10
+ Phone Numbers:
+ Voice 367-9812
+ Fax 367-9813
+ Office 113 Main St. 5
+ Phone Numbers:
+ Main line 123-0001
+ Staff line 123-0002
+ Fax 123-0005
+")
+
+(deftest :p3 (view-to-string mary :vid :compact-text-labels)
+ "Person:
+ first-name Mary last-name Jackson dob Thu, 4 May 2000 03:02:01 resume Style & Grace
+")
+
+(deftest :p4 (view-to-string mary :vid :compact-text)
+"Person:
+ Mary Jackson Thu, 4 May 2000 03:02:01 Style & Grace
+")
+
+(deftest :cv1 (years-at-address home)
+ 10)
+
+(deftest :cv2 (years-at-address office)
+ 5)
+
+(deftest :cv3 (equal (create-time mary) *now*)
+ t)
+
+(deftest :s1 (slot-value (class-of mary) 'ho::user-name)
+ "Person")