[elephant-cvs] CVS elephant/tests

ieslick ieslick at common-lisp.net
Mon Apr 23 02:26:54 UTC 2007


Update of /project/elephant/cvsroot/elephant/tests
In directory clnet:/tmp/cvs-serv18051/tests

Modified Files:
	testcollections.lisp 
Log Message:
:from-end option for map-index and simple test; better error handling and argument checking

--- /project/elephant/cvsroot/elephant/tests/testcollections.lisp	2007/04/06 02:51:50	1.20
+++ /project/elephant/cvsroot/elephant/tests/testcollections.lisp	2007/04/23 02:26:54	1.21
@@ -325,6 +325,19 @@
        10945 ;; sum 990 to 1000 inclusive
        ))
 
+(deftest map-index-from-end
+    (let ((sum 0))
+      (flet ((collector (key value pkey)
+	       (incf sum (slot1 value))))
+	(map-index #'collector index1 :start nil :end 10 :from-end t)
+	(map-index #'collector index1 :start 990 :end nil :from-end t)
+	(map-index #'collector index1 :start 400 :end 410 :from-end t))
+      sum)
+  #.(+ 49 ;; sum 4-10 inclusive (1-3 removed by here)
+       4455 ;; sum 690-700 inclusive
+       10945 ;; sum 990 to 1000 inclusive
+       ))
+
 (deftest rem-kv
     (with-transaction (:store-controller *store-controller*)
       (let ((ibt (make-indexed-btree *store-controller*)))




More information about the Elephant-cvs mailing list