Add a test for m.c/insert-batch with lazy sequence inputs
This commit is contained in:
parent
082a3ec7b7
commit
3af05ef74c
1 changed files with 8 additions and 0 deletions
|
|
@ -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)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue