X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-oodml.lisp;h=39d7eea3f5e40fdb9d80c8eed5801805146e087b;hb=021d4ab301e290da50d80e2689a2e71129108248;hp=6ea820a615a97e3f92678cf5831955717ac37679;hpb=1751e5245c270bd1ee854a98dfe6caa665abe34e;p=clsql.git diff --git a/tests/test-oodml.lisp b/tests/test-oodml.lisp index 6ea820a..39d7eea 100644 --- a/tests/test-oodml.lisp +++ b/tests/test-oodml.lisp @@ -54,11 +54,33 @@ :order-by [last-name])) ("Vladamir Lenin" "Vladamir Putin")) -;; sqlite fails this because it is typeless (deftest :oodml/select/5 (length (clsql:select 'employee :where [married] :flatp t)) 3) +(deftest :oodml/select/6 + (let ((a (caar (clsql:select 'address :where [= 1 [emplid]])))) + (values + (slot-value a 'street-number) + (slot-value a 'street-name) + (slot-value a 'city) + (slot-value a 'postal-code))) + 10 "Park Place" "Leningrad" 123) + +(deftest :oodml/select/7 + (let ((a (caar (clsql:select 'address :where [= 2 [emplid]])))) + (values + (slot-value a 'street-number) + (slot-value a 'street-name) + (slot-value a 'city) + (slot-value a 'postal-code))) + nil "" "no city" 0) + +(deftest :oodml/select/8 + (mapcar #'(lambda (e) (slot-value e 'married)) + (clsql:select 'employee :flatp t :order-by [emplid])) + (t t t nil nil nil nil nil nil nil)) + ;; tests update-records-from-instance (deftest :oodml/update-records/1 (values @@ -265,11 +287,11 @@ "Lenin"]]) (("Lenin" "Widgets Inc."))) -;(deftest :oodml/iteration/3 -; (loop for (e) being the tuples in -; [select 'employee :where [married] :order-by [emplid]] -; collect (slot-value e 'last-name)) -; ("Lenin" "Stalin" "Trotsky")) +(deftest :oodml/iteration/3 + (loop for (e) being the records in + [select 'employee :where [< [emplid] 4] :order-by [emplid]] + collect (slot-value e 'last-name)) + ("Lenin" "Stalin" "Trotsky")) ))