X-Git-Url: https://git.jsancho.org/?p=bongodb.git;a=blobdiff_plain;f=tests%2Fsample.scm;h=5054ffeab15680c003ec607677ba94d4d96920c0;hp=899c6e0f710582625d1e8f17620c1bd7d67d2a54;hb=07eed7138a1b4aecb9d8ae0926ba22dc82ebe94e;hpb=0fe9f925e00b6899f3b685082ed9b3374933c527 diff --git a/tests/sample.scm b/tests/sample.scm index 899c6e0..5054ffe 100644 --- a/tests/sample.scm +++ b/tests/sample.scm @@ -25,12 +25,19 @@ (test-assert (collection? col)) ; Insert -(set! col (insert col '((a . 1) (b . 2)) '((a . 10) (b . 20)) '((a . 1) (b . "hello world")))) +(set! col (insert col + '((a . 1) (b . 2)) + '((a . 10) (b . 20)) + '((a . 1) (c . "hello world")))) (test-eqv 3 (count col)) ; Search -(test-eqv 2 (length (find col '((a . 1))))) -(test-eqv 1 (length (find col '((a . 1) (b . 2))))) -(test-eqv 0 (length (find col '((a . "test"))))) +(test-eqv 3 (length (find col))) +(test-eqv 2 (length (find col ($eq 'a 1)))) +(test-eqv 1 (length (find col ($eq 'a 1) ($eq 'b 2)))) +(test-eqv 0 (length (find col ($eq 'a "test")))) + +(test-eqv 2 (length (find col ($exists 'b)))) +(test-eqv 2 (length (find col ($not ($exists 'c))))) (test-end "bongodb")