X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-oodml.lisp;h=7ad67e603754ecfbdedd1a58c59e39846aa72f2e;hb=d5e70925c53fceafcbf9acce87a4c20ca03dc817;hp=df55c38b4f282d15cf136a8a8f97f645f9271dc0;hpb=8972490fe6f9453c5b70dae4fb1141cf9a67f0db;p=clsql.git diff --git a/tests/test-oodml.lisp b/tests/test-oodml.lisp index df55c38..7ad67e6 100644 --- a/tests/test-oodml.lisp +++ b/tests/test-oodml.lisp @@ -103,6 +103,32 @@ (employee-addresses employee2)) ((t t 2 2 2))) + ;; test retrieval is deferred + (deftest :oodm/retrieval/1 + (every #'(lambda (e) (not (slot-boundp e 'company))) + (select 'employee :flatp t)) + t) + + ;; :retrieval :immediate should be boundp before accessed + (deftest :oodm/retrieval/2 + (every #'(lambda (ea) (slot-boundp ea 'address)) + (select 'employee-address :flatp t)) + t) + + (deftest :oodm/retrieval/3 + (mapcar #'(lambda (ea) (typep (slot-value ea 'address) 'address)) + (select 'employee-address :flatp t)) + (t t t t t)) + + (deftest :oodm/retrieval/4 + (every #'(lambda (ea) (slot-boundp (slot-value ea 'address) 'addressid)) + (select 'employee-address :flatp t)) + t) + + (deftest :oodm/retrieval/5 + (mapcar #'(lambda (ea) (slot-value (slot-value ea 'address) 'street-number)) + (select 'employee-address :flatp t :order-by [aaddressid])) + (10 10 nil nil nil)) ;; tests update-records-from-instance (deftest :oodml/update-records/1