[clouchdb-cvs] CVS clouchdb/src
peddy
peddy at common-lisp.net
Sat Dec 29 21:20:28 UTC 2007
Update of /project/clouchdb/cvsroot/clouchdb/src
In directory clnet:/tmp/cvs-serv19849/src
Modified Files:
tests.lisp clouchdb.lisp
Log Message:
Add updated tests tests for field name change
--- /project/clouchdb/cvsroot/clouchdb/src/tests.lisp 2007/12/28 16:25:51 1.8
+++ /project/clouchdb/cvsroot/clouchdb/src/tests.lisp 2007/12/29 21:20:28 1.9
@@ -111,10 +111,10 @@
(deftestsuite clouchdb-general-tests (clouchdb-tests) () ())
(addtest (clouchdb-general-tests)
- (:documentation "Test document-property")
+ (:documentation "Ensure document-property gets correct value from document")
general-tests-document-property
(ensure
- (let ((doc '((:NAME . "name1") (:|Name| . "name2") (:|NaMe| . "NaMe"))))
+ (let ((doc '((:NAME . "Value1") (:|Name| . "Value2") (:|NaMe| . "Value3"))))
(reduce #'(lambda (a b) (and a b))
(mapcar #'(lambda (e)
(equal (cdr (assoc (car e) doc))
@@ -122,36 +122,6 @@
doc)))))
(addtest (clouchdb-general-tests)
- (:documentation "Test document-property using property name strings")
- general-tests-document-property-string
- (ensure-same "name1"
- (document-property "name" '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3"))))
- (ensure-same "name2"
- (document-property "Name" '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3"))))
- (ensure-same "name3"
- (document-property "NaMe" '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3")))))
-
-(addtest (clouchdb-general-tests)
- (:documentation "Test document-property using keyword symbols")
- general-tests-document-property-keyword
- (ensure-same "name1"
- (document-property :NAME '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3"))))
- (ensure-same "name2"
- (document-property :-NAME '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3"))))
- (ensure-same "name3"
- (document-property :-NA-ME'((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3")))))
-
-(addtest (clouchdb-general-tests)
- (:documentation "Test document-property using non-keyword symbols")
- general-tests-document-property-symbol
- (ensure-same "name1"
- (document-property 'name '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3"))))
- (ensure-same "name2"
- (document-property '-name '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3"))))
- (ensure-same "name3"
- (document-property '-na-me '((:NAME . "name1") (:-NAME . "name2") (:-NA-ME . "name3")))))
-
-(addtest (clouchdb-general-tests)
(:documentation "Test case-encoded field name functions")
general-tests-case-encoded
(ensure-same "lowercase" (as-field-name-string (as-keyword-symbol "lowercase")))
--- /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp 2007/12/29 20:03:42 1.16
+++ /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp 2007/12/29 21:20:28 1.17
@@ -50,6 +50,8 @@
"Default external format for document content.")
(defun document-update-notify (fn doc)
+ "Optionally invoke specified function with supplied document, used
+ to invoke user-specified hook functions."
(if fn (funcall fn doc) doc))
;;
More information about the clouchdb-cvs
mailing list