X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-oodml.lisp;h=7ad67e603754ecfbdedd1a58c59e39846aa72f2e;hb=d5e70925c53fceafcbf9acce87a4c20ca03dc817;hp=b3ceddee747d5783265dbc9aa4871887c06ae9f6;hpb=7500a5933c56c68b1ecb16092415d0412efee05e;p=clsql.git diff --git a/tests/test-oodml.lisp b/tests/test-oodml.lisp index b3cedde..7ad67e6 100644 --- a/tests/test-oodml.lisp +++ b/tests/test-oodml.lisp @@ -103,17 +103,33 @@ (employee-addresses employee2)) ((t t 2 2 2))) - ;; :retrieval :immediate should be boundp before accessed + ;; test retrieval is deferred (deftest :oodm/retrieval/1 - (mapcar #'(lambda (ea) (slot-boundp ea 'address)) - (select 'employee-address :flatp t)) - (t t t t t)) + (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 (values