r11859: Canonicalize whitespace
[clsql.git] / tests / test-ooddl.lisp
index 48d1630fd6a815acb8636d491f2e390170c2cafd..bd54611e95576fdc156ef86c1cd35e4578055b02 100644 (file)
 
 (setq *rt-ooddl*
       '(
-       
+
 ;; Ensure slots inherited from standard-classes are :virtual
 (deftest :ooddl/metaclass/1
-    (values 
-     (clsql::view-class-slot-db-kind
-      (clsql::slotdef-for-slot-with-class 'extraterrestrial
+    (values
+     (clsql-sys::view-class-slot-db-kind
+      (clsql-sys::slotdef-for-slot-with-class 'extraterrestrial
                                              (find-class 'person)))
-     (clsql::view-class-slot-db-kind
-      (clsql::slotdef-for-slot-with-class 'hobby (find-class 'person))))
+     (clsql-sys::view-class-slot-db-kind
+      (clsql-sys::slotdef-for-slot-with-class 'hobby (find-class 'person))))
   :virtual :virtual)
 
 ;; Ensure all slots in view-class are view-class-effective-slot-definition
 (deftest :ooddl/metaclass/2
     (values
      (every #'(lambda (slotd)
-                (typep slotd 'clsql::view-class-effective-slot-definition))
-            (clsql::class-slots (find-class 'person)))
+                (typep slotd 'clsql-sys::view-class-effective-slot-definition))
+            (clsql-sys::class-slots (find-class 'person)))
      (every #'(lambda (slotd)
-                (typep slotd 'clsql::view-class-effective-slot-definition))
-            (clsql::class-slots (find-class 'employee)))
+                (typep slotd 'clsql-sys::view-class-effective-slot-definition))
+            (clsql-sys::class-slots (find-class 'employee)))
      (every #'(lambda (slotd)
-                (typep slotd 'clsql::view-class-effective-slot-definition))
-            (clsql::class-slots (find-class 'company))))
+                (typep slotd 'clsql-sys::view-class-effective-slot-definition))
+            (clsql-sys::class-slots (find-class 'company))))
   t t t)
 
 (deftest :ooddl/join/1
@@ -66,8 +66,8 @@
         (clsql:execute-command "set datestyle to 'iso'"))
       (clsql:update-records [employee] :av-pairs `((birthday ,now))
                            :where [= [emplid] 1])
-      (let ((dbobj (car (clsql:select 'employee :where [= [birthday] now] 
-                                     :flatp t))))
+      (let ((dbobj (car (clsql:select 'employee :where [= [birthday] now]
+                                      :flatp t))))
         (values
          (slot-value dbobj 'last-name)
          (clsql:time= (slot-value dbobj 'birthday) now))))
         (clsql:update-records [employee] :av-pairs `((birthday ,now))
                              :where [= [emplid] 1])
         (let ((dbobj (car (clsql:select 'employee :where [= [birthday] now]
-                                       :flatp t))))
+                                        :flatp t))))
           (unless (clsql:time= (slot-value dbobj 'birthday) now)
             (setf fail-index x))
           (setf now (clsql:roll now :day (* 10 x)))))
       fail-index)
   -1)
 
+(deftest :ooddl/time/3
+    (progn
+      (when (member *test-database-underlying-type* '(:postgresql :postgresql-socket))
+        (clsql:execute-command "set datestyle to 'iso'"))
+      (let ((dbobj (car (clsql:select 'employee :where [= [emplid] 10]
+                                      :flatp t))))
+        (list
+         (eql *test-start-utime* (slot-value dbobj 'bd-utime))
+         (clsql:time= (slot-value dbobj 'birthday)
+                      (clsql:utime->time (slot-value dbobj 'bd-utime))))))
+  (t t))
+
 ))
 
 #.(clsql:restore-sql-reader-syntax-state)