r11085: support clisp
[hyperobject.git] / tests.lisp
index 31bd7fafeb8bf239182e9e736c8de67ca238d285..15dc08203d0a69c3debf75a8d337b6d5a27b8e01 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2003
 ;;;;
-;;;; $Id: tests.lisp,v 1.7 2003/05/14 08:30:38 kevin Exp $
+;;;; $Id$
 ;;;;
 ;;;; This file is Copyright (c) 2000-2003 by Kevin M. Rosenberg
 ;;;; *************************************************************************
@@ -40,7 +40,7 @@
    (addresses :initarg :addresses :accessor addresses
               :subobject t))
   (:metaclass hyperobject-class)
-  (:default-initargs :first-name "" :last-name "" :dob 0 :resume nil) 
+  (:default-initargs :first-name "" :last-name "" :dob 0 :resume nil)
   (:default-print-slots first-name last-name dob resume)
   (:user-name "Person")
   (:description "A Person")
@@ -58,7 +58,7 @@
    (phones :initarg :phones :accessor phones
            :subobject t))
   (:metaclass hyperobject-class)
-  (:default-initargs :title nil :street nil) 
+  (:default-initargs :title nil :street nil)
   (:user-name "Address" "Addresses")
   (:default-print-slots title street)
   (:description "An address"))
@@ -90,7 +90,7 @@
 (defparameter office (make-instance 'address :title "Office" :street "113 Main St."
                                    :phones (list office-phone-1 office-phone-2 office-phone-3)))
 
-                             
+
 (defparameter mary (make-instance 'person :first-name "Mary" :last-name "Jackson"
                            :dob (encode-universal-time
                                  1 2 3 4 5 2000)
 
 (rem-all-tests)
 
-(deftest p1 (view-to-string mary) "Person:
+(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) "Person:
+(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
       Fax 123-0005
 ")
 
-(deftest p3 (view-to-string mary :category :compact-text-labels)
+(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 :subobjects t :category :html-labels)
-  "<p><b>Person:</b></p><div class=\"person\"><ul>
-<li><span class=\"label\">first-name</span> <span class=\"first-name\">Mary</span> <span class=\"label\">last-name</span> <span class=\"last-name\">Jackson</span> <span class=\"label\">dob</span> <span class=\"dob\">Thu, 4 May 2000 03:02:01</span> <span class=\"label\">resume</span> <span class=\"resume\">Style & Grace</span>
-  <p><b>Addresses:</b></p><div class=\"address\"><ul>
-  <li><span class=\"label\">title</span> <span class=\"title\">Home</span> <span class=\"label\">street</span> <span class=\"street\">321 Shady Lane</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\">Voice</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">367-9812</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Fax</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">367-9813</span>
-    </li>
-    </ul></div>
-  </li>
-  <li><span class=\"label\">title</span> <span class=\"title\">Office</span> <span class=\"label\">street</span> <span class=\"street\">113 Main St.</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\">Main line</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0001</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Staff line</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0002</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Fax</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0005</span>
-    </li>
-    </ul></div>
-  </li>
-  </ul></div>
-</li>
-</ul></div>
-")
-
-
-
-(deftest p5 (view-to-string mary :subobjects t :category :html)
-  "<p><b>Person:</b></p><div class=\"person\"><ul>
-<li><span class=\"first-name\">Mary</span> <span class=\"last-name\">Jackson</span> <span class=\"dob\">Thu, 4 May 2000 03:02:01</span> <span class=\"resume\">Style & Grace</span>
-  <p><b>Addresses:</b></p><div class=\"address\"><ul>
-  <li><span class=\"title\">Home</span> <span class=\"street\">321 Shady Lane</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"title\">Voice</span> <span class=\"phone-number\">367-9812</span>
-    </li>
-    <li><span class=\"title\">Fax</span> <span class=\"phone-number\">367-9813</span>
-    </li>
-    </ul></div>
-  </li>
-  <li><span class=\"title\">Office</span> <span class=\"street\">113 Main St.</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"title\">Main line</span> <span class=\"phone-number\">123-0001</span>
-    </li>
-    <li><span class=\"title\">Staff line</span> <span class=\"phone-number\">123-0002</span>
-    </li>
-    <li><span class=\"title\">Fax</span> <span class=\"phone-number\">123-0005</span>
-    </li>
-    </ul></div>
-  </li>
-  </ul></div>
-</li>
-</ul></div>
-")
-
-(deftest p6 (view-to-string mary :subobjects t :category :html-labels)
-  "<p><b>Person:</b></p><div class=\"person\"><ul>
-<li><span class=\"label\">first-name</span> <span class=\"first-name\">Mary</span> <span class=\"label\">last-name</span> <span class=\"last-name\">Jackson</span> <span class=\"label\">dob</span> <span class=\"dob\">Thu, 4 May 2000 03:02:01</span> <span class=\"label\">resume</span> <span class=\"resume\">Style & Grace</span>
-  <p><b>Addresses:</b></p><div class=\"address\"><ul>
-  <li><span class=\"label\">title</span> <span class=\"title\">Home</span> <span class=\"label\">street</span> <span class=\"street\">321 Shady Lane</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\">Voice</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">367-9812</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Fax</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">367-9813</span>
-    </li>
-    </ul></div>
-  </li>
-  <li><span class=\"label\">title</span> <span class=\"title\">Office</span> <span class=\"label\">street</span> <span class=\"street\">113 Main St.</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\">Main line</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0001</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Staff line</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0002</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Fax</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0005</span>
-    </li>
-    </ul></div>
-  </li>
-  </ul></div>
-</li>
-</ul></div>
-")
-
-(deftest p7 (view-to-string mary :subobjects t :category :xml)
-  "<personlist><title>Person:</title>
-<person><first-name><![CDATA[Mary]]></first-name> <last-name><![CDATA[Jackson]]></last-name> <dob><![CDATA[Thu, 4 May 2000 03:02:01]]></dob> <resume><![CDATA[Style & Grace]]></resume>
-  <addresslist><title>Addresses:</title>
-  <address><title><![CDATA[Home]]></title> <street><![CDATA[321 Shady Lane]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><title><![CDATA[Voice]]></title> <phone-number><![CDATA[367-9812]]></phone-number>
-</phone>
-    <phone><title><![CDATA[Fax]]></title> <phone-number><![CDATA[367-9813]]></phone-number>
-</phone>
-    </phonelist>
-</address>
-  <address><title><![CDATA[Office]]></title> <street><![CDATA[113 Main St.]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><title><![CDATA[Main line]]></title> <phone-number><![CDATA[123-0001]]></phone-number>
-</phone>
-    <phone><title><![CDATA[Staff line]]></title> <phone-number><![CDATA[123-0002]]></phone-number>
-</phone>
-    <phone><title><![CDATA[Fax]]></title> <phone-number><![CDATA[123-0005]]></phone-number>
-</phone>
-    </phonelist>
-</address>
-  </addresslist>
-</person>
-</personlist>
-")
-
-(deftest p8 (view-to-string mary :subobjects t  :category :xml-labels)
-  "<personlist><title>Person:</title>
-<person><label>first-name</label> <first-name><![CDATA[Mary]]></first-name> <label>last-name</label> <last-name><![CDATA[Jackson]]></last-name> <label>dob</label> <dob><![CDATA[Thu, 4 May 2000 03:02:01]]></dob> <label>resume</label> <resume><![CDATA[Style & Grace]]></resume>
-  <addresslist><title>Addresses:</title>
-  <address><label>title</label> <title><![CDATA[Home]]></title> <label>street</label> <street><![CDATA[321 Shady Lane]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><label>title</label> <title><![CDATA[Voice]]></title> <label>phone-number</label> <phone-number><![CDATA[367-9812]]></phone-number>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Fax]]></title> <label>phone-number</label> <phone-number><![CDATA[367-9813]]></phone-number>
-</phone>
-    </phonelist>
-</address>
-  <address><label>title</label> <title><![CDATA[Office]]></title> <label>street</label> <street><![CDATA[113 Main St.]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><label>title</label> <title><![CDATA[Main line]]></title> <label>phone-number</label> <phone-number><![CDATA[123-0001]]></phone-number>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Staff line]]></title> <label>phone-number</label> <phone-number><![CDATA[123-0002]]></phone-number>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Fax]]></title> <label>phone-number</label> <phone-number><![CDATA[123-0005]]></phone-number>
-</phone>
-    </phonelist>
-</address>
-  </addresslist>
-</person>
-</personlist>
-")
-
-(deftest p9 (view-to-string mary :subobjects t  :category :ie-xml-link-labels)
-  "<personlist><title>Person:</title>
-<person><label>first-name</label> <first-name><![CDATA[Mary]]></first-name> <label>last-name</label> <html:a href=\"disp-func1?func=FIND-PERSON-BY-LAST-NAME&amp;key=Jackson&amp;narrow=yes\"><![CDATA[Jackson]]></html:a> <label>dob</label> <dob><![CDATA[Thu, 4 May 2000 03:02:01]]></dob> <label>resume</label> <resume><![CDATA[Style & Grace]]></resume>
-  <addresslist><title>Addresses:</title>
-  <address><label>title</label> <title><![CDATA[Home]]></title> <label>street</label> <street><![CDATA[321 Shady Lane]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><label>title</label> <title><![CDATA[Voice]]></title> <label>phone-number</label> <html:a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=367-9812\"><![CDATA[367-9812]]></html:a>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Fax]]></title> <label>phone-number</label> <html:a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=367-9813\"><![CDATA[367-9813]]></html:a>
-</phone>
-    </phonelist>
-</address>
-  <address><label>title</label> <title><![CDATA[Office]]></title> <label>street</label> <street><![CDATA[113 Main St.]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><label>title</label> <title><![CDATA[Main line]]></title> <label>phone-number</label> <html:a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0001\"><![CDATA[123-0001]]></html:a>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Staff line]]></title> <label>phone-number</label> <html:a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0002\"><![CDATA[123-0002]]></html:a>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Fax]]></title> <label>phone-number</label> <html:a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0005\"><![CDATA[123-0005]]></html:a>
-</phone>
-    </phonelist>
-</address>
-  </addresslist>
-</person>
-</personlist>
-")
-
-(deftest p10 (view-to-string mary :subobjects t  :category :xml-link-labels)
-  "<personlist><title>Person:</title>
-<person><label>first-name</label> <first-name><![CDATA[Mary]]></first-name> <label>last-name</label> <xmllink xlink:type=\"simple\" xlink:href=\"disp-func1?func=FIND-PERSON-BY-LAST-NAME&amp;key=Jackson&amp;narrow=yes\"><![CDATA[Jackson]]></xmllink> <label>dob</label> <dob><![CDATA[Thu, 4 May 2000 03:02:01]]></dob> <label>resume</label> <resume><![CDATA[Style & Grace]]></resume>
-  <addresslist><title>Addresses:</title>
-  <address><label>title</label> <title><![CDATA[Home]]></title> <label>street</label> <street><![CDATA[321 Shady Lane]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><label>title</label> <title><![CDATA[Voice]]></title> <label>phone-number</label> <xmllink xlink:type=\"simple\" xlink:href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=367-9812\"><![CDATA[367-9812]]></xmllink>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Fax]]></title> <label>phone-number</label> <xmllink xlink:type=\"simple\" xlink:href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=367-9813\"><![CDATA[367-9813]]></xmllink>
-</phone>
-    </phonelist>
-</address>
-  <address><label>title</label> <title><![CDATA[Office]]></title> <label>street</label> <street><![CDATA[113 Main St.]]></street>
-    <phonelist><title>Phone Numbers:</title>
-    <phone><label>title</label> <title><![CDATA[Main line]]></title> <label>phone-number</label> <xmllink xlink:type=\"simple\" xlink:href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0001\"><![CDATA[123-0001]]></xmllink>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Staff line]]></title> <label>phone-number</label> <xmllink xlink:type=\"simple\" xlink:href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0002\"><![CDATA[123-0002]]></xmllink>
-</phone>
-    <phone><label>title</label> <title><![CDATA[Fax]]></title> <label>phone-number</label> <xmllink xlink:type=\"simple\" xlink:href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0005\"><![CDATA[123-0005]]></xmllink>
-</phone>
-    </phonelist>
-</address>
-  </addresslist>
-</person>
-</personlist>
-")
-
-(deftest p11 (view-to-string mary :subobjects t :category :xhtml)
-  "<p><b>Person:</b></p><div class=\"person\"><ul>
-<li><span class=\"first-name\"><![CDATA[Mary]]></span> <span class=\"last-name\"><![CDATA[Jackson]]></span> <span class=\"dob\"><![CDATA[Thu, 4 May 2000 03:02:01]]></span> <span class=\"resume\"><![CDATA[Style & Grace]]></span>
-  <p><b>Addresses:</b></p><div class=\"address\"><ul>
-  <li><span class=\"title\"><![CDATA[Home]]></span> <span class=\"street\"><![CDATA[321 Shady Lane]]></span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"title\"><![CDATA[Voice]]></span> <span class=\"phone-number\"><![CDATA[367-9812]]></span>
-    </li>
-    <li><span class=\"title\"><![CDATA[Fax]]></span> <span class=\"phone-number\"><![CDATA[367-9813]]></span>
-    </li>
-    </ul></div>
-  </li>
-  <li><span class=\"title\"><![CDATA[Office]]></span> <span class=\"street\"><![CDATA[113 Main St.]]></span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"title\"><![CDATA[Main line]]></span> <span class=\"phone-number\"><![CDATA[123-0001]]></span>
-    </li>
-    <li><span class=\"title\"><![CDATA[Staff line]]></span> <span class=\"phone-number\"><![CDATA[123-0002]]></span>
-    </li>
-    <li><span class=\"title\"><![CDATA[Fax]]></span> <span class=\"phone-number\"><![CDATA[123-0005]]></span>
-    </li>
-    </ul></div>
-  </li>
-  </ul></div>
-</li>
-</ul></div>
-")
-
-(deftest p12 (view-to-string mary :subobjects t :category :xhtml-labels)
-  "<p><b>Person:</b></p><div class=\"person\"><ul>
-<li><span class=\"label\">first-name</span> <span class=\"first-name\">Mary</span> <span class=\"label\">last-name</span> <span class=\"last-name\">Jackson</span> <span class=\"label\">dob</span> <span class=\"dob\">Thu, 4 May 2000 03:02:01</span> <span class=\"label\">resume</span> <span class=\"resume\">Style & Grace</span>
-  <p><b>Addresses:</b></p><div class=\"address\"><ul>
-  <li><span class=\"label\">title</span> <span class=\"title\">Home</span> <span class=\"label\">street</span> <span class=\"street\">321 Shady Lane</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\">Voice</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">367-9812</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Fax</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">367-9813</span>
-    </li>
-    </ul></div>
-  </li>
-  <li><span class=\"label\">title</span> <span class=\"title\">Office</span> <span class=\"label\">street</span> <span class=\"street\">113 Main St.</span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\">Main line</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0001</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Staff line</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0002</span>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\">Fax</span> <span class=\"label\">phone-number</span> <span class=\"phone-number\">123-0005</span>
-    </li>
-    </ul></div>
-  </li>
-  </ul></div>
-</li>
-</ul></div>
-")
-
-(deftest p13 (view-to-string mary :subobjects t :category :xhtml-link-labels)
-  "<p><b>Person:</b></p><div class=\"person\"><ul>
-<li><span class=\"label\">first-name</span> <span class=\"first-name\"><![CDATA[Mary]]></span> <label>last-name</label> <a href=\"disp-func1?func=FIND-PERSON-BY-LAST-NAME&amp;key=Jackson&amp;narrow=yes\"><![CDATA[Jackson]]></a> <span class=\"label\">dob</span> <span class=\"dob\"><![CDATA[Thu, 4 May 2000 03:02:01]]></span> <span class=\"label\">resume</span> <span class=\"resume\"><![CDATA[Style & Grace]]></span>
-  <p><b>Addresses:</b></p><div class=\"address\"><ul>
-  <li><span class=\"label\">title</span> <span class=\"title\"><![CDATA[Home]]></span> <span class=\"label\">street</span> <span class=\"street\"><![CDATA[321 Shady Lane]]></span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\"><![CDATA[Voice]]></span> <label>phone-number</label> <a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=367-9812\"><![CDATA[367-9812]]></a>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\"><![CDATA[Fax]]></span> <label>phone-number</label> <a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=367-9813\"><![CDATA[367-9813]]></a>
-    </li>
-    </ul></div>
-  </li>
-  <li><span class=\"label\">title</span> <span class=\"title\"><![CDATA[Office]]></span> <span class=\"label\">street</span> <span class=\"street\"><![CDATA[113 Main St.]]></span>
-    <p><b>Phone Numbers:</b></p><div class=\"phone\"><ul>
-    <li><span class=\"label\">title</span> <span class=\"title\"><![CDATA[Main line]]></span> <label>phone-number</label> <a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0001\"><![CDATA[123-0001]]></a>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\"><![CDATA[Staff line]]></span> <label>phone-number</label> <a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0002\"><![CDATA[123-0002]]></a>
-    </li>
-    <li><span class=\"label\">title</span> <span class=\"title\"><![CDATA[Fax]]></span> <label>phone-number</label> <a href=\"disp-func1?func=SEARCH-PHONE-NUMBER&amp;key=123-0005\"><![CDATA[123-0005]]></a>
-    </li>
-    </ul></div>
-  </li>
-  </ul></div>
-</li>
-</ul></div>
+(deftest :p4 (view-to-string mary :vid :compact-text)
+"Person:
+  Mary Jackson Thu, 4 May 2000 03:02:01 Style & Grace
 ")