X-Git-Url: http://git.kpe.io/?p=hyperobject.git;a=blobdiff_plain;f=tests.lisp;fp=tests.lisp;h=ff66b6fdd760fe46fa0edc78be50d096fa7537e0;hp=d6a7d2e2e2810e9dce1fa8be5b0c3c1465a5cfed;hb=4a772392fd77659637f19c6d0b69584974a40074;hpb=2609d271cb408331a31374739154d0c11d7afb6d diff --git a/tests.lisp b/tests.lisp index d6a7d2e..ff66b6f 100644 --- a/tests.lisp +++ b/tests.lisp @@ -21,27 +21,27 @@ (defclass person (hyperobject) ((first-name :initarg :first-name :accessor first-name - :value-type (varchar 20) - :value-constraint stringp - :null-allowed nil) + :value-type (varchar 20) + :value-constraint stringp + :null-allowed nil) (last-name :initarg :last-name :accessor last-name - :value-type (varchar 30) - :value-constraint stringp - :hyperlink find-person-by-last-name - :hyperlink-parameters (("narrow" . "yes")) - :null-allowed nil) + :value-type (varchar 30) + :value-constraint stringp + :hyperlink find-person-by-last-name + :hyperlink-parameters (("narrow" . "yes")) + :null-allowed nil) (full-name :value-type string :stored nil) (dob :initarg :dob :accessor dob - :value-type integer - :print-formatter date-string - :value-constraint integerp - :input-filter convert-to-date) + :value-type integer + :print-formatter date-string + :value-constraint integerp + :input-filter convert-to-date) (resume :initarg :resume :accessor resume - :value-type string - :value-constraint stringp) + :value-type string + :value-constraint stringp) ;; (addresses :value-type (list-of subobject) :initarg :addresses :accessor addresses)) (addresses :initarg :addresses :accessor addresses - :subobject t) + :subobject t) (create-time :accessor create-time :compute-cached-value (get-now))) (:metaclass hyperobject-class) (:default-initargs :first-name "" :last-name "" :dob 0 :resume nil) @@ -50,17 +50,17 @@ (:description "A Person") (:direct-rules (:rule-1 (:dependants (last-name first-name) :volatile full-name) - (setf full-name (concatenate 'string first-name " " last-name))))) + (setf full-name (concatenate 'string first-name " " last-name))))) (defclass address (hyperobject) ((title :initarg :title :accessor title - :value-type (varchar 20) - :value-constraint stringp) + :value-type (varchar 20) + :value-constraint stringp) (street :initarg :street :accessor street - :value-type (varchar 30) - :value-constraint stringp) + :value-type (varchar 30) + :value-constraint stringp) (phones :initarg :phones :accessor phones - :subobject t) + :subobject t) (years-at-address :initarg :years-at-address :value-type fixnum :accessor years-at-address :value-constraint integerp)) @@ -72,12 +72,12 @@ (defclass phone (hyperobject) ((title :initarg :title :accessor title - :value-type (varchar 20) - :value-constraint stringp) + :value-type (varchar 20) + :value-constraint stringp) (phone-number :initarg :phone-number :accessor phone-number - :value-type (varchar 16) - :value-constraint stringp - :hyperlink search-phone-number)) + :value-type (varchar 16) + :value-constraint stringp + :hyperlink search-phone-number)) (:metaclass hyperobject-class) (:user-name "Phone Number") (:default-initargs :title nil :phone-number nil) @@ -93,18 +93,18 @@ (defparameter home (make-instance 'address :title "Home" :street "321 Shady Lane" :years-at-address 10 - :phones (list home-phone-1 home-phone-2))) + :phones (list home-phone-1 home-phone-2))) (defparameter office (make-instance 'address :title "Office" :street "113 Main St." :years-at-address 5 - :phones (list office-phone-1 office-phone-2 office-phone-3))) + :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) - :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)