Add a test for m.c/insert-batch with lazy sequence inputs

This commit is contained in:
Michael Klishin 2013-03-17 19:55:19 +04:00
parent 082a3ec7b7
commit 3af05ef74c

View file

@ -161,3 +161,11 @@
(dotimes [n 44]
(is (monger.result/ok? (mc/insert-batch monger.core/*mongodb-database* "people" docs WriteConcern/NORMAL))))
(is (= 88 (mc/count collection)))))
(deftest insert-a-batch-of-basic-documents-from-a-lazy-sequence
(let [collection "people"
numbers (range 0 1000)]
(is (monger.result/ok? (mc/insert-batch "people" (map (fn [^long l]
{:n l})
numbers))))
(is (= (count numbers) (mc/count collection)))))