X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-oodml.lisp;h=804248bcb09ff262a94145124a828c2e16cd1df5;hb=1c5166f0e106b086a5f50a7ce5af2f50d6c6b58e;hp=d6cd8fe9f7cbf6d94fc563fc252219efb467b9ae;hpb=a91ef336e5401ba5acbe0cf66447eeae7d4cad50;p=clsql.git diff --git a/tests/test-oodml.lisp b/tests/test-oodml.lisp index d6cd8fe..804248b 100644 --- a/tests/test-oodml.lisp +++ b/tests/test-oodml.lisp @@ -59,7 +59,7 @@ 3) (deftest :oodml/select/6 - (let ((a (caar (clsql:select 'address :where [= 1 [emplid]])))) + (let ((a (caar (clsql:select 'address :where [= 1 [addressid]])))) (values (slot-value a 'street-number) (slot-value a 'street-name) @@ -68,7 +68,7 @@ 10 "Park Place" "Leningrad" 123) (deftest :oodml/select/7 - (let ((a (caar (clsql:select 'address :where [= 2 [emplid]])))) + (let ((a (caar (clsql:select 'address :where [= 2 [addressid]])))) (values (slot-value a 'street-number) (slot-value a 'street-name) @@ -81,6 +81,27 @@ (clsql:select 'employee :flatp t :order-by [emplid])) (t t t nil nil nil nil nil nil nil)) +(deftest :oodml/select/9 + (mapcar #'(lambda (pair) + (list + (typep (car pair) 'address) + (typep (second pair) 'employee-address) + (slot-value (car pair) 'addressid) + (slot-value (second pair) 'addressid))) + (employee-addresses employee1)) + ((t t 1 1) (t t 2 2))) + +(deftest :oodml/select/10 + (mapcar #'(lambda (pair) + (list + (typep (car pair) 'address) + (typep (second pair) 'employee-address) + (slot-value (car pair) 'addressid) + (slot-value (second pair) 'addressid))) + (employee-addresses employee2)) + ((t t 2 2))) + + ;; tests update-records-from-instance (deftest :oodml/update-records/1 (values @@ -289,7 +310,7 @@ (deftest :oodml/iteration/3 (loop for (e) being the records in - [select 'employee :where [married] :order-by [emplid]] + [select 'employee :where [< [emplid] 4] :order-by [emplid]] collect (slot-value e 'last-name)) ("Lenin" "Stalin" "Trotsky"))